Results 1 to 3 of 3

Thread: Fixing a 3D object in relation to the camera

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2009
    Posts
    5

    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

  2. #2
    Senior Member Regular Contributor
    Join Date
    Dec 2008
    Location
    USA
    Posts
    134

    Re: Fixing a 3D object in relation to the camera

    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.

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2009
    Posts
    5

    Re: Fixing a 3D object in relation to the camera

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

Similar Threads

  1. Help fixing please
    By wadadli in forum OpenGL: User Software
    Replies: 0
    Last Post: 09-23-2016, 11:55 AM
  2. Fixing backprojection
    By Robotnik in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-29-2011, 06:46 PM
  3. Drawing stationary text in relation to the camera
    By Psiborg in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-05-2006, 07:10 AM
  4. Fixing meshes...
    By NitroGL in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 11-07-2002, 02:17 PM
  5. Urgent help needed on fixing object coordinates
    By Tony Chen in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 03-20-2001, 11:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean