-
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.
-
Advanced Member
Frequent Contributor
Re: Bypassing OpenGL T&L
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
-
Re: Bypassing OpenGL T&L
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);
-
Re: Bypassing OpenGL T&L
Uhm.. almost.
glOrtho(0.0f, 640.0f, 0.0f, 480.0f, -1.0f, 1.0f);
-
Advanced Member
Frequent Contributor
Re: Bypassing OpenGL T&L
Oups sorry. I didn't read the message correctly!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules