If I have multiple meshes in a single VBO, is there a way to apply transformations to those meshes independently?
If I call glDrawElements while a VBO with two meshes is bound, it’s going to draw those two meshes with whatever the current MVP matrix is. So if I have upwards of 20 independently moving meshes on the screen at a time, would I need 20 VBOs? Or is there some way of specifying an offset and a count to glDrawElements so that it only renders the first mesh stored in the VBO? This way I could change the MVP Matrix and then render the second mesh in the VBO.
Say you have three meshes with 5, 11 and 13 triangles respectively packed into one index buffer, you can draw the two separate meshes as:
You specify the offset by offsetting the pointer in the last argument.