Results 1 to 2 of 2

Thread: glScalef() PushMatrix, PopMatrix()

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2005
    Posts
    4

    glScalef() PushMatrix, PopMatrix()

    I am just wondering when do you have to use the Push and Pop Matrix...in the openGL book examples it uses throughout the drawPicture program...

    Also, where do I put glScalef() to scale the lines that I am drawing? Can I scale down the lines? If so can you show me a simple code that would do such thing after calling RenderScene from Main()?

    Last question, my backround appears the same as the desktop....what am I doing wrong here? I can't seem to know how to fix it.

    Thanks in advance for your response.

  2. #2
    Guest

    Re: glScalef() PushMatrix, PopMatrix()

    I am just wondering when do you have to use the Push and Pop Matrix...in the openGL book examples it uses throughout the drawPicture program...
    push/pop give you a way to save and restore the state of your matrices while you load other matrices onto the stack. it stricly a convenience thing. you could just as well create your matrices and load them with glLoadMatrix. it's up to you, but i think the push/pop thing is very handly, especially for hierarchical structures.

    Also, where do I put glScalef() to scale the lines that I am drawing? Can I scale down the lines? If so can you show me a simple code that would do such thing after calling RenderScene from Main()?
    more often than not you'll probably want scaling applied first, before rotations and translations. so in opengl, this means calling glScale last, right before you issue geometry commands like glVertex.

    my backround appears the same as the desktop....what am I doing wrong here?
    are you actually clearing the frame buffer and swapping buffers? are you using glut?

Similar Threads

  1. pushMatrix- PopMatrix
    By AmitGupta in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 02-09-2009, 11:36 AM
  2. pushmatrix and popmatrix
    By hoganh in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-27-2003, 11:55 PM
  3. Invariance after PushMatrix/PopMatrix?
    By Tom Nuydens in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 04-14-2003, 05:56 AM
  4. PushMatrix, PopMatrix
    By jirkamelich in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-26-2002, 10:04 AM
  5. pushmatrix and popmatrix
    By fox in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 09-05-2000, 10:51 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