Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Bypassing OpenGL T&L

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Lawrence, KS USA
    Posts
    6

    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.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    569

    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

  3. #3

    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);

  4. #4

    Re: Bypassing OpenGL T&L

    Uhm.. almost.

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

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    569

    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
  •