Results 1 to 4 of 4

Thread: Zooming and clipping

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2002
    Location
    Germany
    Posts
    24

    Zooming and clipping

    Hello,

    i' am using gluPerspective to setup the projection-matrix and gluLookAt to position the camera. When i perform a zoom, i modify the distance between eye-point and reference-point (both parameters for gluLookAt). When the distance is less or equal to the boundingsphere-radius, the objects will be partially clipped, so that i can look inside, what looks terrible. Is there a way, that i can zoom without the described effect ?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Zooming and clipping

    The object is being clipped by the near plane, and there's no way to stop it from being clipped. All you can do to prevent it, is stop zooming when you are close enough.

  3. #3
    Member Contributor nemesis's Avatar
    Join Date
    Nov 2001
    Posts
    80

    Re: Zooming and clipping

    You don't want to look inside, do you?

    Maybe you can test the distance beetwen the camera and the object and don't allow to go ahead if it is less than the bounding-radius.

    Is it what you where asking?

    -nemesis-

  4. #4
    Member Contributor
    Join Date
    Jun 2001
    Posts
    55

    Re: Zooming and clipping

    eh? zomming has nothing to do with the clipping planes!

    this is the matrix: (perspective, lefthanded, postmultiplied)
    A 0 0 0
    0 B 0 0
    0 0 C D
    0 0 1 0

    A = 1.0 / tan(Angle / 2.0 / 180.0 * M_PI) / Aspect
    B = 1.0 / tan(Angle / 2.0 / 180.0 * M_PI)
    C = (Far + Near) / (Far - Near)
    D = -2.0 * Far * Near / (Far - Near)

    where
    Near = near clipping plane
    Far = far clipping plane
    Angle = opening angle of the 'camera' (zoom)
    Aspect = aspect ratio of the screen (normally 4.0/3.3)

Similar Threads

  1. Zooming
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-19-2004, 07:11 AM
  2. Replies: 1
    Last Post: 09-02-2003, 01:45 PM
  3. Clipping (not clipping) in opengl
    By FunkyLovin in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 06-04-2001, 05:08 AM
  4. zooming
    By David in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-04-2001, 02:09 PM
  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