PDA

View Full Version : Fixed image when panning



Loderunner
02-16-2010, 01:09 PM
So this is a question regarding layers.
I want to have a fixed axis placed on my graphic even when I pan around. How would I go about doing this? Any suggestions would be appreciated.

strattonbrazil
02-16-2010, 04:05 PM
On your graphic? What is your graphic? A quad? You mean your screen? You want something that stays fixed in your viewport? Does it need to be in 3D? If not...

// render scene
...

// get ready for 2D projection
glDisable(GL_DEPTH_TEST) // if on
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0,graphicWidth,0,graphicHeight,-1,1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()

// render fixed axis (with depth buffer off)

Loderunner
02-18-2010, 02:26 PM
Thanks stratton,
I'll give it a shot and let you know how it goes.