PDA

View Full Version : How to draw a 3D object at a fixed screen location



yaoshan
01-18-2002, 10:22 AM
I am trying to draw a 3D object at the lower-right corner of the window. This object's 3D orientation should be the same as the scene's current orientation as the user do panning, rotating, zoomming, etc., and it should not change its size on the screen. How do I do this ?

bleach
01-21-2002, 02:35 AM
It's all to do with pushMatrix and popMatrix.
You need to push the current matrix before you start drawing anything, if you draw your things you want to remain stationary with the view here and then push the matrix again before using the translate/rotate commands then drawing the things you want to pan etc in the main view it should work. You'll need to play with translation and rotations...

eg:
glPushMatrix();
glPushMatrix();
//tanslate/Rotate stuff for the little 'compass thing'
glPopMatrix();
//stuff to stay stationary
glPushMatrix();
//translate/Rotate stuff for main view
//stuff to rotate in the main view
glPopMatrix();
glPopMatrix();