3D (With OpenGL)Meshes and Animations: How do I make it warks?

Not talking about videos (Since I know how bad that is)! No, I’m talking about just doing frame-based drawing and animation.

I already know the basics about doing things, like getting it to draw on the screen, getting textures to draw on 'em, etc. No, I’m talking about two separate issues which I’d like some opinions on.

  1. Groups: If you have several objects that you will be drawing in the same area (A ‘squad’ of troops for instance, where you have one mesh per person in the squad) is it better to combine all of the smaller meshes into a single larger mesh and draw it just once, or to draw the small single person mesh several times (Translating as need be to position them correctly).

I figure that the second one would have the benefits of differing the current frame/state of each person, as well as allowing you to place things at different heights. However, I’m more talking performance wise (And yes, I’m working on this in the hopes that I can put it on something like my crappy little phone, so 3D speed is important.)

  1. Animations: Would processing some sort of mesh animation file (Such as MD5 Animations) be better than doing something like creating several different .obj (Or other still frame format) and loading those up, then handling the animation by just specifying which loaded mesh I want to draw.
  1. Keep individual meshes for each unit in the squad. Having all troops of a squad in the same mesh would mean that you can’t move and animate the units individually. They will literally be glued together. I wouldn’t worry about performance in this case. If your graphics card can handle drawing the troops, it doesn’t matter if they are in one mesh or many meshes. However, if your individual units are very low-poly (<500 vertices or so maybe) and you have over like 2000 of them, you could get a CPU bottleneck due to your CPU not being able to send instructions fast enough to your GPU. In this case the solution isn’t to combine meshes but to use more advanced rendering techniques like instancing, which allows you to draw multiple instances of the same mesh without doing OpenGL calls for each instance, but seriously, you don’t need it unless you’re making an insanely large-scale strategy game.

  2. There are two animation techniques: bone/skeleton animation and key frame animation. Bone animation is pretty tricky to get working since it uses lots of matrix math, and you most likely want to do it in a shader to get decent performance. If you have no idea what a shader is (or a matrix xd), don’t try it.
    Key frame animation is a LOT simpler. Just keep multiple complete meshes for different “frames” in the animation.

You should look at the source code of some modern scenegraphs, it would be a nice source of inspiration.

Well, as I said, I’m planning on trying to get this to work on my crappy ass Samsung Traverse (So I’ll have a game I want to play on my phone when I’m waiting). So performance is something of an issue here. However, the other comments do make sense.

I’m going to try to keep it low Vertex for the multiple instance troops (I can’t say how many, 'cause I haven’t done it yet, but fairly simple) and a low number of troops on screen (I’m thinking eight per tile, with a maximum of like 100 tiles on screen at a time… With a limit of the number of units. Hah.)

As for the Matrix? Is that where Neo lives?.. But no, really. I understand the basics of it (It’s the thinger that holds the position, rotation, etc for the OpenGL instance you’re sending stuff to. Works as the origin for drawing things, etc.)

I was somewhat worried about the size that a bunch of key frames would get up to. But, I would guess, that they would take up less in the Memory than the flat file would.