Hi,
i got a little problem here.
on init o do:
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0f,(GLfloat)Width/(GLfloat)Height,0.1f,500.0f);
glMatrixMode(GL_MODELVIEW);
on my frame-rendering i do:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-75.0f);
glRotatef(pitch,1.0f,0.0f,0.0f);
glRotatef(heading,0.0f,1.0f,0.0f);
glTranslatef(xtra,ytra,zoom);
no i need to implement picking.
what do i need beside the picking part (init of the buffer and switching to GL_SELECT) where to put my rotate stuf to place me at the right point in the world:
glMatrixMode(GL_PROJECTION);
glPushMatrix();
gluPickMatrix((GLdouble) mouse_x, (GLdouble) (viewport[3]-mouse_y), 1.0f, 1.0f, viewport);
// Apply The Perspective Matrix
gluPerspective(45.0f, (GLfloat) (viewport[2]-viewport[0])/(GLfloat) (viewport[3]-viewport[1]), 0.1f, 100.0f);
glMatrixMode(GL_MODELVIEW);
drawmydatawiththeglloadname();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);