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 :cool:
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 :o