Results 1 to 2 of 2

Thread: GL_PROJECTION stack

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2002


    Could anybody give me an example
    for using GL_PROJECTION stack?
    I mean, why should one use the history
    of PROJECTION matrices instead of
    single PROJECTION matrix.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000

    Re: GL_PROJECTION stack

    If you, for a short while, want to use a different projection, the projection stack is usefull.

    Say, for example, you render your scene in perspective projection. When the scene is drawn, you want to draw some text ontop of everything. Push the projection matrix stack, set a new projection matrix, preferably an orthographic with 1:1 window coordinate to viewport coordinate mapping, and draw yuor text. When done, pop the stack and you have your old projection matrix back. The text drawing function does not have to know about the old projection matrix to recreate it afterwards.

Similar Threads

  1. Using matrix stack - my code seems to modify the whole stack
    By chromosom in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-04-2014, 03:12 AM
  2. glMatrixMode(GL_PROJECTION) ?
    By CroCodile in forum OpenGL: Basic Coding
    Replies: 13
    Last Post: 10-09-2013, 07:49 AM
  3. How to set GL_PROJECTION?
    By amidofu in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-06-2010, 03:02 PM
  4. glPushMatrix and GL_PROJECTION
    By ajbiv in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-17-2009, 03:39 PM
    By imported_robert in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 11-02-2000, 04:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean