Skip to main content

Problem with RotationInterpolator

2 replies [Last post]
MarcE
Offline
Joined: 2006-02-17

Hi,

I'm using Rotationinterpolator for rotating a TransformGroup. It should rotate around an certain angle; after that it should move further after clicking on a button.
Unfortunally it stops after the first rotation and I don't know how to get it moving further...

I'm using the following code for rotating around the Z-axis.

Transform3D rotatorTransform3D = new Transform3D();
rotatorTransform3D.rotX(java.lang.Math.PI / 2.);
rotator.setTransformAxis(rotatorTransform3D);
rotator.setAlpha(new Alpha(1, 3000));
rotator.setTarget(objectGroup);
rotator.setMinimumAngle(0.0f);
rotator.setMaximumAngle((float)Math.toRadians((double)degree));
rotator.setEnable(true);

This just works for the first time...after that nothing moves anymore...
What's my fault?

Greetz,
Marc

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
aces
Offline
Joined: 2003-07-17

well, your alpha is set to just one cycle.
Set it to infinite cycles(-1) and just stop and go your alpha when needed. Alpha javadocs will help you.

Alessandro

voldor
Offline
Joined: 2005-09-06

Did you finallysolve your problem ?

Mine is the following.
I would like to animate a cube rotation of PI/2 each time user hit a specific key. I don't know how to stop and restart the alpha correctly in order to do it at the right time.

Does anybody could help me please ?