[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[www-vrml] OPEN--GL Question



Hello everybody

I am new in the business of computer graphics and of course 3D. I had a problem with transformations in OPENGL. My program, it is supposed that should make the rotations ans translations of an object, it works but the object rotates just on its own axis X Y Z, I need that it rotate around the Space. I know and I read that I need to multiply the matrix by the matrix inverse but it didn't work or ?I don't know how. could you have a view on it and if somebody know what do I need or send me a link to any web page with examples or a good explanation on what do I need.
void WireGL::paintGL()
{


printf("On est ds paintgl. xTranslat = %f\n",xTranslat);
printf("Angles GLfloat phiRot, thetaRot, rhoRot : %f, %f, %f\n",phiRot,thetaRot,rhoRot);


glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

//trace le repère mondial
glColor3f((GLfloat)0.7, (GLfloat)0.0, (GLfloat)0.1);
axis(1,0,0,2);
axis(0,1,0,2);
axis(0,0,1,2);

//applique les transformations
glRotatef(phiRot,1,0,0);
glRotatef(thetaRot,0,1,0);
glRotatef(rhoRot,0,0,1);
glTranslatef(xTranslat,yTranslat,zTranslat);


glCallList(object);

//retourne dans le repère initial
glTranslatef(-xTranslat,-yTranslat,-zTranslat);
glRotatef(-rhoRot,0,0,1);
glRotatef(-thetaRot,0,1,0);
glRotatef(-phiRot,1,0,0);

glFlush();

}

--
Best Regards
M. Sc. Juan Manuel González Calleros Ph. D. Student


Université catholique de Louvain (UCL)
School of Management (IAG)
Unit of Information Systems (ISYS)

Place des Doyens, 1 (office a.036)
Louvain-la-Neuve, Belgium P.C. 1348


E-mail: gonzalez@isys.ucl.ac.be
E-mail: jmgonzalez@inaoep.mx E-mail:jumagoca78@hotmail.com web: http://www.isys.ucl.ac.be/bchi/members/jgo/index.htm


Phone: +32 10/478349
Fax: +32 10/478324

-------------------------------------------------------------------------
for list subscription/unsubscription,
go to http://www.web3d.org/cgi-bin/public_list_signup/lwgate/listsavail.html