Finally, animations are coming to World of Towers. This is an important and huge step for the WOT project. At this time, I decided to implement simple animation support without the use of skeletal animation techniques. This saves me the need of implementing a vertex shader with skinning support and furthermore I don’t need to add a new model loader that supports armatures.
Currently the Nice3D engine does not support shader other than the one in GLKit. Sure, own shader handing is a must have for a modern 3d engine, but Nice3D is not there yet. The other side is a skinning shader alone would not make the creeps walk. It would need to be fed by bone transformations and vertex weights. To get these structures I would have to use an other model format than Wavefront OBJ. I have a COLLADA loader (which would do the trick) integrated into Nice3D already, but it outputs some strange results.
So, how is it actually done?
The animations are done via vertex and normal morphing between keyframes. All keyframes are stored in separate OBJ files. Only vertex positions and normals are exported to the keyframes. The walk cycle for instance is compound of three different keyframes. But still, smooth animation is possible. It is just the matter of interpolating vertex positions and normals between the keyframes. This is how animations were done in Quake II those days.
The technique has some downsides. You can get wobble effects if you rotate joints of your 3d character and are using too few keyframes. An other downside is the fact that storing the keyframe requires of course way more space than storing a skeletal pose. Finally I should not forget to mention, that you need to cache the interpolated animations on the iPad for performance reasons. This leads to more memory consumption and hence less free memory for other fancy things.