PDA

View Full Version : Bypassing OpenGL T&L



jyk
02-16-2000, 04:54 PM
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.

Gorg
02-16-2000, 05:40 PM
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

Hude
02-16-2000, 10:15 PM
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);

Hude
02-16-2000, 10:16 PM
Uhm.. almost.

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

Gorg
02-17-2000, 09:05 AM
Oups sorry. I didn't read the message correctly!