Tuesday, December 7, 2010

Character Animation, Part I

Over the past month I've worked hard to complete one of the major features of the engine: keyframe character animation. As of this post, the engine is only supporting a customized format which can be exported from Blender (via a Python script). Here is a recent test I performed on the engine by exporting a spinning cube animation out of Blender:


The fps rate is decent (for a basic six-year old video card) even on animations with hundreds of triangles. At some point, however, I'd like to experiment with pushing all of the individual keyframe renderings into display lists instead of doing all the interpolation on the fly.

A decision was made early on (by me) to go with keyframe animation versus bone animation. Someday I hope to add a much more comprehensive set of animation functions that could handle multiple formats.

One thing to note, however, is that many of the objects in this engine (lights, models, billboards, character animations) are all full class objects with inhertiable properties from the parent class of "jObject". The basic jObject class declaration looks like this:

class jObject
{
     public:

     float mass; // for physics calculations
     j3Dvector location;
     j3Dvector velocity;
     j3Dvector acceleration;
     j3Drotation rotation;
     objectstate state;
};

I have lots of ideas for these properties, but the obvious one is the soon-to-be-implemented feature of collision detection and basic physics calculations. :-)

No comments:

Post a Comment