Path: chuka.playstation.co.uk!news From: "Markus Tesche" Newsgroups: scea.yaroze.programming.3d_graphics Subject: Re: Quaternion 2 Matrix ... Date: Mon, 24 May 1999 11:57:01 +0200 Organization: PlayStation Net Yaroze (SCEE) Lines: 66 Message-ID: <7ib7u5$sfd3@chuka.playstation.co.uk> References: <7i9jkp$lic17@chuka.playstation.co.uk> <7i9p8e$hd3@scea> <7i9rjf$lic18@chuka.playstation.co.uk> <7i9sqd$hd4@scea> NNTP-Posting-Host: 33-144.H.dial.o-tel-o.net X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Hi Mike, let me tell you ... Michael Hough schrieb in Nachricht <7i9sqd$hd4@scea>... >Where are you getting your quaternions from? OK, I wrote a little Program which uses DirectX Files that includes animations into TMD Files liked together to one File and adding the fixedpoint Animationdata to them. That works really nice, I tooh the IDirect3DRMFrame TransformationMatrix to get the Translation, the Scaling and the Quaternion from the rotation. Thats works very well, if I play my playback the AnimFile under Direct3DRM, I generate the TransformationMatrix from the Quaternion like this one I stored before, the adding the Scaling and the Translation. Looks good ! Now my problem is that on the psx the y-coordinate is inverse the DirectX, ok I solved that by using a negativ y-scaling. On the PSX I generate the RotationMatrix from the Quaternion from like in my firt posting an thean Iīm going to do this: .... MATRIX* tempMatrix1; // scale the Matrix ... tempMatrix1 = ScaleMatrix(rotationMatrix, scaleVector); // The Rotation Matrix generated from the Quaternion // Now scaled // set position by absolute coordinates tempMatrix1->t[0] = translationVector->vx; // And translated ... tempMatrix1->t[1] = translationVector->vy; tempMatrix1->t[2] = translationVector->vz; // assign new matrix to coordinate system coordSystem->coord = *tempMatrix1; That all looks good but for some Rotationstates the rotation looks very wrong. I tried may objects, 90 % looks complete and good but the rest had show some rotation errors ... hmm bad, ok after that I used the AnimFile to OpenGL, works great so what the hell is wrong on my Quaternions, oh I forget, my rotaions are all Unit Quaternions ... I thought about the problem like you also suggest concerning the y-Axis ... >I had some problems because I used to use RotMatrix() to generate my >rotations, and it rotates in z,y,x order rather than the x,y,z order my >quaternions used to use. OK, at first how you used RotMatrix donīt you convert your quaternion directly to the Matrix ?? If I convert directly to the RotationMatrix, I think the rotationorder is X-Y-Z but for the GTE thats isnīt interesting couse the GTE does applies only the Matrix to the Objects coords I think ( I hope) ... So whats wrong, I used many sign combinations but that one I stored generates less of errors ... But thats not ok OK, yes hmm I hope thats a better explanation of the Problem ... Bye MT