[info-performer] Re: Rotate an object ...

New Message Reply Date view Thread view Subject view Author view

From: Florian Berger (florian.berger++at++aec.at)
Date: 10/03/2002 03:01:44


On Thursday 03 October 2002 08:57 am, you wrote:
> Hi florian,
> i used this instruction in order to rotate a single group of an obj file
> around a generic point :
>
> ( C++ code )
>
> #include<pfLinMath.h>
> ....
> pfMatrix tmat,mat1;
>
> mat1.makeIdent();
> tmat.makeIdent();
> for ( z=0;z<360;z+=0.5f)
> {
> mat1.makeRot(z,0,0,1);
> tmat.preTrans(x_g,y_g,z_g,tmat);
> tmat.preMult(mat1);
> tmat.preTrans(-x_g,-y_g,-z_g,tmat);
> dcs->setMat(tmat);
> pfFrame();
> }
>
> where :
> ( x_g,y_g,z_g) is the point around wiche i want to rotate my
> obj ( loaded in dcs )
>
> bye :)

i see... yes,
i finally found out what the problem was.

the order is the opposite one as used in opengl and therefore the matrices
are the transposed ones (so actually everything the same - just philosopy).
"pre" means actually that the operation is performed before every other
operation (which would be the rightmost matrix in opengl, when the vector is
multiplied right to the matrix).

thanx,
  floh

------------------------------------------------------------
Dipl.-Ing. Florian Berger
Email: florian.berger++at++aec.at
Homepage: http://www.geocities.com/harpin_floh


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Oct 03 2002 - 02:59:55 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.