I really want clarification, on the coordinate systems that are available with OpenGL.
This is what I know:
Model Coordinates are coordinates that are local to a object. Were the origin is usually at the center of the object. Common in software packages like Blender and other modeling tools.
World Coordinates are coordinates, that hold all the objects in the space. Were the origin is usually at a specific area in the world.
View coordinates is were the origin is usually on the viewer or camera.
Clip space is were coordinates are clipped by dividing the w component with the rest of the components x, y, z.
Screen coordinates are coordinates that have the origin at the lower left corner of the screen. The X axis increases to the right, Y axis increases up.
My questions are:
1) How does one go about getting the model coordinates of an object using OpenGL? Say for example one is constructing a Cube with the following vertices:
const GLfloat vertices[] =
{
-0.5f, 0.5f, 0.0f, // Top Left
-0.5f, -0.5f, 0.0f, // Bottom Left
0.5f, -0.5f, 0.0f, // Bottom Right
0.5f, 0.5f, 0.0f, // Top Right
-0.5f, 0.5f, -1.0f, // Top Left (back)
-0.5f, -0.5f, -1.0f, // Bottom Left (back)
0.5f, -0.5f, -1.0f, // Bottom Right (back)
0.5f, 0.5f, -1.0f // Top Right (back)
};
and the following indices:
const int indices[] =
{
0, 1, 3,
1, 2, 3,
4, 5, 6,
4, 6, 7,
4, 5, 1,
1, 0, 4,
3, 6, 2,
7, 6, 3,
7, 4, 3,
4, 0, 3,
1, 2, 5,
2, 5, 6
};
2) How does one activate the view coordinate system? Because it appears by default, when you execute the program, the viewer is essentially staring at world space.
* What are the uses of view coordinate spaces, any way?
3) How is screen coordinate system accessed? How does one go about interacting with the screen coordinate system?
4) What is the point of clip space? In most of my OpenGL programs so far, most of my data values have been between -1 and 1. And from my understanding, this is where the w component is divided with the other components, where normalized device coordinates are produced.
const GLfloat vertices[] =
{
-0.5f, 0.5f, 0.0f, // Top Left
-0.5f, -0.5f, 0.0f, // Bottom Left
0.5f, -0.5f, 0.0f, // Bottom Right
0.5f, 0.5f, 0.0f, // Top Right
-0.5f, 0.5f, -1.0f, // Top Left (back)
-0.5f, -0.5f, -1.0f, // Bottom Left (back)
0.5f, -0.5f, -1.0f, // Bottom Right (back)
0.5f, 0.5f, -1.0f // Top Right (back)
};
5) Even without the use of model, view, and projection matrix; Is the order in which coordinates system are transformed still, local -> world -> view -> clip -> screen or does execution just skip directly to world coordinate space.