PDA

View Full Version : question about viewing plane



edwong
09-27-2003, 07:47 PM
Hi,
I need to transform pseudo code into opengl code for a perspective viewing plane.

PERS 45, 5.17, 10.7
TRAN -0.1,-1.6,7.9
ROT -90, 1
ROT -30, 3
ROT 0,1
TRAN 0,0,0
SCAL 1,1,-1

I try to do something like

glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluPerspective
(45.0, (GLfloat) w/(GLfloat) h, 5.17, 10.7);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef (-0.1, -1.6, 7.9);

then i came to the problem of rotation. glrotatef() takes 4 arguments, but it looks like the pesudo code only have 2.

or am i just totally off by doing things like this?

thank you

Bob
09-27-2003, 08:33 PM
I would guess the second parameter of ROT specifies about which axis to rotate. 1=x, 2=y and 3=z. If so, just pass the proper axis to glRotate.