Absolute/relative coordinates

Started by
1 comment, last by 0v3rloader 16 years, 9 months ago
Quote:From OpenGL FAQ: 9.050 What are the pros and cons of using absolute versus relative coordinates? Some OpenGL applications may need to render the same object in multiple locations in a single scene. OpenGL lets you do this two ways: 1) Use “absolute coordinates". Maintain multiple copies of each object, each with its own unique set of vertices. You don't need to change the ModelView matrix to render the object at the desired location. 2) Use “relative coordinates". Keep only one copy of the object, and render it multiple times by pushing the ModelView matrix stack, setting the desired transform, sending the geometry, and popping the stack. Repeat these steps for each object. In general, frequent changes to state, such as to the ModelView matrix, can negatively impact your application’s performance. OpenGL can process your geometry faster if you don't wrap each individual primitive in a lot of changes to the ModelView matrix.
I'm a bit unsure as to what's meant by using "absolute coordinates" and "maintain[ing] multiple copies of each object" and particularly the "need [not] to change the ModelView matrix", as I thought you always have to specify the transform (change the modelview matrix) regardless of however you choose to hold object's in memory (duplicates or not.) Also how does this differ from the "use [of] relative coordinates?" [Edited by - 0v3rloader on July 25, 2007 10:07:34 PM]
Advertisement
(1) refers to a situation where a program, to move a car 10 meters to the right, actually edits all the vertices of the car to add 10 to them. In this situation, a separate transformation matrix is not used. This is the approach generally used for particle systems. It is not widely used otherwise.
Quote:Original post by Sneftel
(1) refers to a situation where a program, to move a car 10 meters to the right, actually edits all the vertices of the car to add 10 to them. In this situation, a separate transformation matrix is not used. This is the approach generally used for particle systems. It is not widely used otherwise.


Good stuff! Confusion now gone, mind clear, future is bright again > thanks!

:-)

This topic is closed to new replies.

Advertisement