PDA

View Full Version : Rotations and "flying" my eyepoing



thebamaman
11-01-2000, 04:43 PM
If I have some code that looks like this:

glPushMatrix();
glRotated(-roll,0,0,1);
glRotated(-pitch,??,??,??);
glRotated(-yaw,??,??,??);
glTranslated(-dx-eyex,-dy-eyey,-dz-eyez);
glPushMatrix();
do some object rotates here
drawSomeComplexObject();
glPopMatrix();
glPopMatrix();

and I am trying to fly my eyepoint where once I roll,the axes still are in the same position(y up,x l and r, z out of screen) and without using gluLookAt or quaternions, what should I fill in for the question marks. I have been told to use some combination of trig functions, but I don't know which ones and of what order.

Can anyone help?

11-02-2000, 04:58 PM
You need top remove the first Push Mtrix and the last PopMatrix..so it looks like

glRotated(-roll,0,0,1);
glRotated(-pitch,1,0,0);
glRotated(-yaw,0,1,0);
glTranslated(-dx-eyex,-dy-eyey,-dz-eyez);

glPushMatrix();
Any transformation to object
drawSomeComplexObject();
glPopMatrix();

if needed

glPushMatrix();
Any transformation to object
drawOtherObject();
glPopMatrix();

*******

That's it