Results 1 to 4 of 4

Thread: Pushing&Popping Vs LoadIdentity

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2001
    Posts
    2

    Pushing&Popping Vs LoadIdentity

    In my code I need to do change the camera position as fast as possible many times, and it would be really handy to know what is the fastest way to change the Modelview matrix, basically does anyone know which is faster:

    glLoadIdentity()
    gluLookAt(View1)...

    glLoadIdentity()
    gluLookAt(View2)...

    glLoadIdentity()
    gluLookAt(View3)...
    etc...

    or
    glLoadIdentity()

    glPushMatrix()
    gluLookAt(View1)...
    glPopMatrix()

    glPushMatrix()
    gluLookAt(View2)...
    glPopMatrix()

    glPushMatrix()
    gluLookAt(View3)...
    glPopMatrix()
    etc...

    Or is there no difference?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    State College, PA
    Posts
    186

    Re: Pushing&Popping Vs LoadIdentity

    Compared to the time it takes to render your scene between calls, there is virtually no difference. If I had to guess, though, I'd say that the glLoadIdentity is marginally faster. Though as usual, this is probably hardware dependant.

    Chris

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2001
    Posts
    2

    Re: Pushing&Popping Vs LoadIdentity

    Cheers I was kind of expecting there to be not much in it. The scene takes virtually no time to render, and the viewpoint is changed every frame so thats why I wanted it fast as possible.

  4. #4
    Senior Member Regular Contributor
    Join Date
    May 2000
    Location
    Oxford, England
    Posts
    472

    Re: Pushing&Popping Vs LoadIdentity

    Unless you views need to change, you could place the calls in display lists. But if the code is fast enough already then there may be little point.

Similar Threads

  1. Pushing / popping the current program
    By phoenix_wrath in forum OpenGL: Advanced Coding
    Replies: 14
    Last Post: 02-13-2011, 09:34 PM
  2. Help needed with ModelView Matrix, Pushing and Popping
    By DragonSpawn in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-26-2005, 12:20 AM
  3. pushing/popping attrib array enables
    By Stephen_H in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 03-02-2004, 10:32 AM
  4. Pushing and Popping Material Colour in a Display List
    By Furrage in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-09-2002, 02:03 AM
  5. pushing and popping
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-17-2002, 02:44 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