The [i]Concept[/i] of Animation in 3D


I’ve been reading the tutorials on animation for jMe and I noticed that all of them use a transformer of some type for another. Is this the common way of doing animation in jMe?

In 2D, I could easily specify acceleration and velocity and the likes by implementing them myself

long currentTime = System.currentTimeMillis();
  int timePassed = System.currentTimeMillis()-currentTime;
  currentTime = System.currentTimeMillis();

But how would you do these complex animations in jMe, acceleration and velocity need to be accurate. I can't imagine doing this using SpatialTransfomer?

You have free reign to position nodes by hand if you need accuracy that controllers don’t give you. Just setLocalTranslation, setLocalRotation, setLocalScale. Those three methods will let you position a node anywhere at any orientation.

Is there a method that I can put that in? Like a method that’s called before every paint?

I want to achieve a perfect - update , paint, update, paint, update, paint, etc… synchronization.

simpleUpdate is called before every paint and simpleRender is called during every paint. Read through the tutorial about SimpleGame.

The abstract game loop is:

while (!finished && !display.isClosing()) {
        //update game state, do not use interpolation parameter
        update( -1.0f);

        //render, do not use interpolation parameter
        render( -1.0f);

        //swap buffers

So, if you are using anything other than SimpleGame use the update method, if you ARE using SimpleGame override

protected void simpleUpdate()

That’s perfect. That’s exactly what I needed.