Hello. I would like to get some clarifications about the projection and model-view matrices (after having read some chapters about them).

I have a cube with geometry 2x2x2.

The vertex shader takes a projection (proj_matrix) matrix and a model-view (mv_matrix) matrix as input.

Code :gl_Position = proj_matrix * mv_matrix * position;

When I render it, the mv_matrix consists only of one translation.

Code :vmath::mat4 mv_matrix = vmath::translate(object_position.x, object_position.y, object_position.z);

The projection matrix is updated on WM_SIZE callback:

Code :glViewport(0, 0, window_dims.width, window_dims.height); aspect = (float)window_dims.width / (float)window_dims.height; proj_matrix = vmath::perspective(FOVY_PERSPECTIVE, aspect, NEAR_PERSPECTIVE, FAR_PERSPECTIVE);

Questions:

1. The rendering volume is limited: x is [-1,1], y is [-1,1], z is [0,1]. How does the cube fit into this volume? 2x2x2 is more than the rendering volume, but in the window it is rendered smaller and fits good.

2. mv_matrix in my example does only the positioning of the cube in the world coordinates, doesn't it? I.e. from the local coordinates to the world coordinates?

3. proj_matrix: NEAR_PERSPECTIVE is 0.1f, FAR_PERSPECTIVE is 1000.0f. This values limit the "visibility zone". But, agan, how 1000.0f is connected with the rendering volume of x is [-1,1], y is [-1,1], z is [0,1]? What is the "real" rendering volume dimensions then?

4. proj_matrix: how do we know the position of the camera and its direction?

how do we know if the camera's top is pointing up? How to change it?

how do we know where the camera is pointing to? How to change it?