website | twitter

Tuesday, September 28, 2004

Animated Mesh

I am building an animation class for Croquet. I have implemented similar mechanism for 3DSMax ASE format, but I am rebuild new class because old one was depend on ASE. The new one would be more compact, clean and readable. There is an issue about where should an animation scheduler belong. Defining animation is easy because animation could regard as function for time, but scheduling animation has environment specific problems. I have several option. - In a TFrame : TFrame and Morph has basic animation mechanism named stepping. This is most straightforward and easy option. An object starts heartbeat itself. - In global scheduler : In instance, AbstractSound uses global scheduler in Squeak. This way has a benefit that it is easy to blend two motions. I could make a scheduler in each TeaParty in Croquet. - In the user camera : Probably it is good for performance. When we don't see an animated object, the animation doesn't need to move. And to put scheduler in the camera, the frame rate of animation could be changed dynamically according to machine performance. At first, I will use TFrame to set scheduler.


  1. A subclass of TFrame is absolutely the best place to put this. It is a bad idea to put these kinds of things into more global areas - better to localize it as much as possible. Each object has the ability to act as it's own scheduler via the step mechanism.

    If you are maintaining some kind of counter in the step, you can use the render to actually perform the change in the animation. This is not called unless the object is actually visible (that is, it's boundSphere is visible). So have the step take care of where in the animation you are and use the render to actually do it. This applies to blending motions as well.

  2. Thank you for the advice. Yes, the render in TFrame seems the best place for scheduling. Other issue is how should I implement the interfarce of animation. I think the nature of the animation is like Player in Morphic, but TPlayer is not used in latest Croquet image. In SolarCroquet, we could apply multiple behaviors into one TFrame. This is one of the ways I want to do.


Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.