what are model/object/eye/world/screen coordinates?

satya - Tue Aug 28 2012 14:27:27 GMT-0400 (Eastern Daylight Time)

what are model/object/eye/world/screen coordinates?

what are model/object/eye/world/screen coordinates?

Search for: what are model/object/eye/world/screen coordinates?

satya - Tue Aug 28 2012 14:28:18 GMT-0400 (Eastern Daylight Time)

This is a nice link: http://www.songho.ca/opengl/gl_transform.html

This is a nice link: http://www.songho.ca/opengl/gl_transform.html

satya - Tue Aug 28 2012 14:29:54 GMT-0400 (Eastern Daylight Time)

are opengl object and model coordinates the same?

are opengl object and model coordinates the same?

Search for: are opengl object and model coordinates the same?

satya - Tue Aug 28 2012 14:35:19 GMT-0400 (Eastern Daylight Time)

Here is a bit more clarified link

Here is a bit more clarified link

satya - Tue Aug 28 2012 14:48:03 GMT-0400 (Eastern Daylight Time)

This has more accurate definition of what these are

This has more accurate definition of what these are

satya - Tue Aug 28 2012 14:49:56 GMT-0400 (Eastern Daylight Time)

You start with Object coordinates

Each object in a scene can define its own coordinates including their origin and size etc. These are the coordinates that you use with glVertexPointer or glVertexAttribArray.

satya - Tue Aug 28 2012 14:53:58 GMT-0400 (Eastern Daylight Time)

Then you have World coordinates

This is where you use glTranslate, Scale etc to translate the object and place it in a conceptual world coordinates. You can place multiple objects in this world with relation to each other. The spec says the world coordinates are purely application constructs and OpenGL does not recognize them in any special way.

The transforms that take a single object and place it on a world can be seen as a modelling transform. As you place each object in the world you may have multiple model transformations one for each object.

satya - Wed Aug 29 2012 09:16:50 GMT-0400 (Eastern Daylight Time)

Next up are Eye coordinates or also called View coordinates

One tyicall uses a Model matrix to transfer an object and place it in the right place in a conceptual world (world coordinates). How ever to give that world a sense of depth and perspective through a viewing angle and a viewing point (like a camera placed and oriented to see the view) these world coordinates gets transformed through the position and orientation of the camera.

The matrix required to translate these vertices through the eye of a camera is called a "View" matrix. The output when multiplied with a view matrix are called "eye" coordinates.

Typically a model matrix and a view matrix are multiplied together to come up with a combined "ModelView" matrix. This matrix is then responsible for translating EACH vertex from its object coordinates into the eye coordinates.

When OpenGl says that it doesn't particularly recognize World coordinates is because there is no "world matrix" unlike a "model" matrix and a "view" matrix. When the model matrix is varies for each object, essentially you are controlling its placement in the world.

satya - Wed Aug 29 2012 10:22:36 GMT-0400 (Eastern Daylight Time)

Device coordinates

The eye coordinates are the output of applying the "model/view" matrix. These coordinates are then transformed by a "projection" matrix to clip and provide depth. The projection matrix is translate them to "x,y" coordinates on the screen.

A projection matrix is obtained by defining a frustum or a viewing volume.

satya - Wed Aug 29 2012 10:23:55 GMT-0400 (Eastern Daylight Time)

Window/Screen coordinates

Finally the projected vertices are transformed by the view port (height and width of the view on the screen) to screen coordinates.

satya - Thu Aug 30 2012 08:50:12 GMT-0400 (Eastern Daylight Time)

At least in Android, there is no matrix that you multiply for view port

Not sure in other OpenGL implementations, but quite likely similar, but in Android there is no matrix that a programmer gets back from using the

GLES20.glViewPort

method. The system (OpenGL) seem to do this final mapping behind the scenes.

In contrast you do have matrices for

Model - through translate, scaling etc
View - by setting the camera position
Projection - by using the frustum

and you compose a final MVP matrix by correspondingly multiplying each in the right order.