PDA

View Full Version : How draw a constant size object in all zoom?



ncn213
08-31-2009, 01:21 PM
I have a simple opengl game. User should find a box.
User select some point and then user icon pass this point one by one.
User need to a compass. I draw a scaled circle as compass that give the degree to user.
User can zoom in and out for find the Destination point.

Problem:
I want that compass and user icon have constant width and height in all zoom. I
change the (x,y) left and right in glortho for zooming. and because of this my compass and
user icon become large and small in zoomin and zoomout.

How can I have them with constant size in all zoom!?

ZbuffeR
08-31-2009, 02:29 PM
Switch your projection matrix to glOrtho and your modelview matrix to identity before rendering your HUD.