Hi everybody!!
I am having a problem with rotations and tried almost everything I remeber
but can't seem to solve it.
Here it goes, in a behavior I am using the following code to translate
and rotate an object.
translate.setTranslation(new Vector3f(transX,transY,transZ));
rotateX.rotX(rotX);
rotateY.rotY(rotY);
rotateZ.rotZ(rotZ);
rotateY.mul(rotateZ);
rotateX.mul(rotateY);
translate.mul(rotateX);
translate.mul(rotateX);
targetTG.setTransform(translate);
/* Even tried the transformation matrix directly, but got the same result
double sinRotY = Math.sin((float)rotY);
double cosRotY = Math.cos((float)rotY);
rotate.setRotation(new Matrix3d(cosRotY,0,sinRotY,
0,1,0,
-sinRotY,0,cosRotY));
*/
With the translation everything is ok, I get absolute positioning and
thats what I want. (with absolute i mean that if I make it move 1.0 and
next 2.0, it will be in position 2.0, not 3.0).
The problem is with the rotations, I can't get absolute rotations, only
incremental. This gives me loads of problems, because I am animating the
direction of a wheel using a slider, with incremental rotations I am
forced to do many complicated calculations, which I really don't want to
do.
Does anyone know a way to use absolute values with rotations?
Thanks,
Joao Francisco
***********************************************************
* JOAO MANUEL DE OLIVEIRA FRANCISCO *
* *
* [EMAIL PROTECTED] *
* http://www.rnl.ist.utl.pt/~jmof *
* *
*Licenciatura Engenharia Informatica e Computadores (LEIC)*
* Instituto Superior Tecnico (IST), Lisboa, Portugal. *
***********************************************************
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".