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: Make a zoom

  1. #1

    Make a zoom

    Hello, i want to make a zoom on an object and my code don't work. Here is what I wrote in my loopback fonction when the mouse moves and the right button is pressed and after I recalculate my zoom variable.
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective((GLfloat)45.0f*(1.0+zoom),(GLfloat) largeur/(GLfloat)hauteur,0.1f,100.0f);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

  2. #2
    Intern Contributor
    Join Date
    Mar 2001
    Location
    Marlborough, MA, USA
    Posts
    68

    Re: Make a zoom

    I think you would find it much easier if you just translated the object closer to the camera rather than messing with the projection matrix. Reading about glPushMatrix() and glPopMatrix() would probably be very beneficial as well.

    Christopher Oat
    ATI Research, Inc.
    3D Application Research Group
    Christopher Oat
    ATI Research, Inc.
    3D Application Research Group

Posting Permissions

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