> What you simply have to do is to apply the transformation in the local
> coordinate system of the Viewplatform. So you do the following:
>
> coordinate transformation to local coordinate system -> applying your
> transformation matrix -> coordinate transformation back to
> virtual coordinate system. Watch order of matrix muliplication.
>
> myViewplatform . getLocalToVworld( vpTransform );
> vpTransform . getRotationScale( itsTempMatrix );
> vpTransform . set( itsTempMatrix );
> itsTempMatrix.transpose();
> tempTransform .set( itsTempMatrix );
> tempTransform . mul( myTransform, itsTempTransform );
> vpTransform . mul( tempTransform );
> // now apply vpTransform to your Viewplatformtransformgroup
Im not exactly sure of how you are doing it, but I think I know what you are
trying to do, and I totaly forgot about that, I had it in the back of my mind
that there is a better way to do it but I could only remember the one with
sinusoids.
But any way, the one presented above is probably better then what I said,
because it does not depend on how you rotate an object, it will move down the
x axis based upon the vector in the views matrix, but I dont think he
accounted for step variable (which can be negative or positive movement)...
and BTW this is how I would do it...
//after you apply your rotations
vpTransform . get( itsTempMatrix4f);
itsTempMatrix4f.m03 += itsTempMatrix4f.m00 * step;
itsTempMatrix4f.m13 += itsTempMatrix4f.m10 * step;
itsTempMatrix4f.m23 += itsTempMatrix4f.m20 * step;
vpTransform. set(itsTempMatrix4f);
// now apply vpTransform to your view
The thing to understand about this... the (m03,m13,m23,m33) are the
translation component of a 4x4 matrix, while (m00,m10,m20,m30) are the x axis
(vector value) of a 4x4 matrix, as seen relative to the world. (note I may
have the values backwards, it may be for example m30,m31,m32,m33 which are
the translation component, in which you would change the x axis and the
translation of the above code to reflect that).
Leyland Needham
===========================================================================
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".