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 2 of 2

Thread: Nested Push/Pop Matrx()

  1. #1
    Intern Contributor
    Join Date
    Apr 2000
    Location
    Staten Island New York
    Posts
    53

    Nested Push/Pop Matrx()

    Do nested Push/Pop Matrix calls work from the inside out? or vice-versa?
    Should the Identity matrix be called before
    every Push/Pop to avoid cumalative results?
    Or what is the result of doing so?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: Nested Push/Pop Matrx()

    The matrix stacks use LIFO logic. The last matrix pushed will be the first matrix to pop off. Each matrix type uses its own matrix stack, so texture matrices don't get mixed with modelview matrices for example.
    You do not need to load an identity matrix before issuing a push or a pop. Popping a matrix loads a matrix from the stack, not multiplies by it. Pushing a matrix leaves the matrix unchanged. You must also be aware of the maximum depth each stack can be, to prevent overflowing the stack.

Posting Permissions

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