Results 1 to 5 of 5

Thread: glulookat not zooming!

  1. #1
    Member Newbie
    Join Date
    Jan 2013
    Posts
    48

    glulookat not zooming!

    Hi,
    I have a model which I can see using gluLookat, I can see the model rotating using glRotated, but if I try and zoom into the model

    from: gluLookAt( 0.0, 0.0, 500.0F, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 );
    to:gluLookAt( 0.0, 0.0, 50.0F, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 );

    there is no change untill the Z value is a value such that the view is the other side of the model when I see a blank screen as one would expect. Anyone got any ideas? Any help gratefully appreciated.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    I would check the rest of your code - those 2 gluLookAts will not render the same thing.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    394
    gluLookAt specfies a viewing direction and camera orientation.
    It does not define a projection. If you are using an orthographic
    projection in your code, your two gluLookAt's should give you the
    same view of your model. The model will only appear to zoom if
    you use a perspective projection (gluperspective) in conjunction
    with gluLookAt.

  4. #4
    V-man
    Guest
    You have to move the eye and center values. That doesn't actually do a zoom, it just translates the camera.
    If you want to do a zoom, you have to make changes to the projection matrix.

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    If you want to do a zoom, you have to make changes to the projection matrix.
    Be aware that if you do this your image can look distorted - like using a wide angle lens on a camera

Similar Threads

  1. zooming - with glulookat()?
    By rebal_ in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 06-21-2013, 09:24 AM
  2. Zooming in and out using gluLookAt|gluPerspective.
    By Waleed in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 12-28-2011, 02:51 AM
  3. zooming
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-10-2005, 11:29 AM
  4. About zooming.
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-15-2004, 11:10 PM
  5. Zooming
    By KurtCob in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 09-18-2000, 05:26 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