Results 1 to 3 of 3

Thread: zooming

  1. #1
    Guest

    zooming

    Can any one please help me out with the code that can do zooming in and out on an object?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Sydney, NSW, Australia
    Posts
    426

    Re: zooming

    gluPerspective(zoom, width/height, 0.1f, 1000.0f);

    lower the value of zoom (a float) to zoom in, increase the value to zoom out.
    Look up the specs on gluPerspective for more info on why that zooms.
    :: Sleep is a poor substitute for caffeine ::

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    Kingston, ON, Canada
    Posts
    7

    Re: zooming

    Just a note, that "ZOOM" value is actually your "field of view", which you may recognize from some games like Quake. A normal FOV value varies but some good numbers between 45 to 60 make a nice normal view. If you want to be able to zoom in when a player presses a key for example, you could gradually lower than value down to 10 when a key is pressed and it will appear to zoom in (smaller field of view), and then of course, just raise that value back up to your normal FOV when the key is released if that is what you like.

Similar Threads

  1. Zooming out
    By Canadian0469 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-19-2008, 01:01 PM
  2. zooming
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-10-2005, 11:29 AM
  3. Zooming in and out
    By SurGL in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-14-2001, 10:57 PM
  4. Zooming
    By KurtCob in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 09-18-2000, 05:26 AM
  5. zooming
    By Harry of DAIW in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 07-26-2000, 03:07 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