Skip to main content

(novice question) how to animate some objects?

1 reply [Last post]
Joined: 2006-03-31

sorry for this (probably very stupid) question...
I have a set of objects (say planes), every plane is able to go from point A to point B. I would like to set up a slider in order to control the positioning of the plane between the two points... But I'm not able to do this...
the only way I found to do this is to put everything inside a BranchGroup and then detach->create a new plane with updated coords->addchild.. Seems not to me a good idea...

Any help or suggestions?
thank you all.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-12-05

Every object that changes its position should be a child of a TransformGroup. If the slider changes, update the Transform3D of the TransformGroup (tG.setTransform(...)).
It shoukd work, but it's better to use a behavior, that updates the TransformGroup. There's a sample, I think it's called "SwingInteraction".