Fixing a 3D object in relation to the camera

Basically i have my 3D game world and a 3D compass model (which rotates as you move the game world around, and therefore allowing you to always know which direction you are facing).

The problem is i need to ‘attach’ this 3D compass to my screen so it is always in the corner of the viewport, regardless of where you point the camera. Something similar to drawing my menus in 2D/ortho mode would be nice. Or am i going to have to use some complicated maths?

Thanks in advance :slight_smile:

I would use similar techniques to drawing menus. Essentially, (I’m in GL2), setup your projection and modelview matricies to draw the compass, then set them up to draw the scene. This way, there is no connection between the compass and the camera, but if you get your transformations correct, it will be in the corner of the screen.

nice one, hadn’t thought of anything like that :slight_smile: i’ll give it a go. Cheers