Thread: Global coordinates in OpenGL?

  1. #1
    Registered User
    Join Date
    Aug 2001

    Global coordinates in OpenGL?

    Is there a built-in function in OpenGL to retrieve vectors (or vertexes) global 3d coordinates? I mean... after all the transformation matrices have been applied to the given relative coordinates of course

    Hmm... Maybe I should be more specific or something...
    Well, lets assume that I have an object in 3d space. Its final position regarding the global coordinates [or more accurately (0.0,0.0,0.0)] is determined by the transformation and rotation matrices applied to the vertexes given between glBegin(); and glEnd();. Now... what I've been doing so far to determine object's global coordinates was a rather complicated (but pretty handy) class inheritance system, where all 3d objects were derived from the same class and had a linked list of all the other objects that were attached to them which I used recursively to get objects' global coordinates. So...uh... just a few minutes it hit me that maybe there's already some kind of a function included in opengl which could do the same check for me and would be both less troublesome to use and more efficient than the current method that I use. Umm... so I'd really appreciate it if somebody could tell me if I'm just dreaming about this function I'm talking about or not
    Sauron a few seconds before his defeat:
    "What? A 'division by 0' error?!?"

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    If you are talking about view space coordinates then after you send your vertexes down the pipeline you can 'undo' the view space transformation by computing the inverse of the view matrix and then using that as your world matrix.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  2. OpenGL coordinates
    By Da-Nuka in forum Game Programming
    Replies: 5
    Last Post: 01-10-2005, 11:26 AM
  3. OpenGL screen view coordinates
    By DavidP in forum Game Programming
    Replies: 1
    Last Post: 03-12-2003, 02:46 PM
  4. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 07:57 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM