Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: glPushMatrix and glPopMatrix?

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2001
    New York, NY, US

    glPushMatrix and glPopMatrix?

    Can somebody do me a favor to tell me:
    1) If I use glPushatrix, how can I make
    a Matrix? I mean, is it an array?
    2) If Matrix is an array, how can I
    retrieve every element in the matrix
    and put them back to the array
    with glPopMatrix?

    Thanks a lot and have a nice day!

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Fargo, ND

    Re: glPushMatrix and glPopMatrix?

    It's automatic. glPushMatrix will push the current matrix onto the top of the stack. glPopMatrix takes the top matrix on the stack and makes it the current matrix. There's no need to get the actual matrix to use these. If you needed the matrix for other reasons, you can get it using glGetFloatfv, but unless you REALLY need to get the matrix, I'd avoid doing that. Getting information back from OpenGL like that works, but you will take a performance hit.
    Software Engineer and OpenGL enthusiast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts