PDA

View Full Version : GL_MODELVIEW



Itun.itu
03-27-2011, 11:11 AM
How I can set a view matrix without glu, simply with 4x4 matrix?

mhagain
03-27-2011, 01:30 PM
Many ways.

glMatrixMode (GL_MODELVIEW);
glLoadMatrixf (my_4x4_matrix);

Or...

glMatrixMode (GL_MODELVIEW);
glFrustum (l, r, b, t, n, f);

Or even (for GLSL):

glUniformMatrix4fv (...etc...);

Alfonse Reinheart
03-27-2011, 02:04 PM
Or...

glMatrixMode (GL_MODELVIEW);
glFrustum (l, r, b, t, n, f);

That's not a view matrix; that's a projection matrix. And those should generally go in the GL_PROJECTION stack.