Bypassing OpenGL T&L

How do I set it up so that I can send viewport coordinates (between 0,0 and 640,480, for example) directly to OpenGL? I know you have to set the modelview and projection matrices to identity, but I don’t quite understand what else I need to do. Something with homogenous coordinates? Any help would be appreciated.

Once the matrices are set to identity, the only thing you have to is :

  1. Calculate your own transformation Matrices
  2. Use the glMultMatrix(not sure about the syntax) so the that your matrices are used.

Gorg

You don’t have to use glMultMatrix if you transform your vertices manually.

If you really want to send coordinates as screen space coordinates use the following:

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0f, 0.0f, 640.0f, 480.0f, -1.0f, 1.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glViewport(0.0f, 0.0f, 640.0f, 480.0f);

Uhm… almost.

glOrtho(0.0f, 640.0f, 0.0f, 480.0f, -1.0f, 1.0f);

Oups sorry. I didn’t read the message correctly!