PDA

View Full Version : rotation



mikethebike
02-23-2012, 02:42 AM
Hi
now I do:
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glFrustum(-0.7, 0.7, -0.7, 0.7, 1, 5000);

glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();

glRotatef(GetDataf(psi), 0, 1, 0);//heading
glRotatef(GetDataf(theta), -1, 0, 0);//pitch
glRotatef(GetDataf(phi), 0, 0, 1);//roll
glTranslatef(-GetDatad(locX), -GetDatad(locY), -GetDatad(locZ));//
positions

drawMesh();

so far all is ok
now I want to rotate the mesh 90' to look from above on it. I've tried
without success:
// glRotatef(90, -1, 0, 0); // look down
// glTranslatef(0.0f, 0.0f, 128.0f);//128x128 mesh
// gluLookAt(0,0,GetDatad(locZ)+2000,0,0,-256,0,1,0);
How to rotate and maybe zoom out?
Many thanks
Michael