Animations- how do you like yours?

Just wondering how other people who are building stuff in j3d are animating things- are you using morphs or ordered transformgroups? Do you use behaviours to move stuff about or do everything frame by frame?

What techniques is everyone out there using and how are they working out?

Well, I am still new to Java3D (just started this summer) so this technique might not be the best but it does work.

For an animation, I use a TransformGroup for what ever object I am animating and set the Transform3D with the updated coordinates (rotation and x,y,z info). So its frame by frame.

I wrote MD2 and MD3 loaders that support animations in Java 3D. For them the seperate frames are collected together inside a switch whose state is changed each frame. I could have used morphs, but for my purposes it was a bit performance heavy.

Generally it depends on the type of animation you are attempting. If you just want to run through a series of frames it might be easy just to generate a set of shape. If you’ve got skeletal information it’ll be easier to use transform groups.

As to when you do the updates, you should really use behaviours, since modifiing the scene graph anywhere else will cause it to redraw.

Kev

http://www.newdawnsoftware.com/

I used skeletal animations for the body and morph-targets for facial expressions. all done in java3d.
I had no problems with two multitextured character consisting of 8k triangles lit by 3 light sources on my notebook (PIII M 1,1Ghz, GeForce 2 GO 32MB, Linux 2.4.19-4GB)

btw. I did not many optimations on the code, but 4 of these characters need better hardware (skin deformation done by vertex shaders would be nice speed-up)

is anyone doing fac…ial animations with textures?
yes? pleaser tell me about the performance

[quote]As to when you do the updates, you should really use behaviours, since modifiing the scene graph anywhere else will cause it to redraw
[/quote]
What do you mean by this? Doesn’t behaviours also couse a redraw too, or are you saying, that if I modify say 1 object’s transform group in a scene, that this will cause the entire scene to redraw? But if I use a behaviour, it will only redraw the object? The latter doesn’t really make sense to me because if the behaviour can only redraw the object, then there should be a way that a non-beaviour method can redraw just 1 object.

Could you explain this?
Thanks

Sure, sorry for the late reply.

If you modify the scene graph (set a transform, update some geometry) outside of behaviours it causes the scene to be redrawn.

If you do your updates inside behaviours, you’re actually in the rendering thread (since behaviours get processed as the scene is drawn) and so the scene doesn’t get a forced redraw.

If you update outside of behaviours you’re likely to get screen drag and strange 3d artifacts.

At least this is the way I understand it.