Results 1 to 3 of 3

Thread: view all, things that are out of the viewing volume although

  1. #1
    Guest

    view all, things that are out of the viewing volume although

    hello,
    i want to change my code that all things are drawn the users have selected.
    if the user wants to draw an trinagle with coordinates out of the viewing volume,
    the volume should change , so that all is visibe.
    how can i do that?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    Caracas/Venezuela
    Posts
    182

    Re: view all, things that are out of the viewing volume although

    You can do something like:
    -calc the bounding box that contains all the objects you want to see
    -calc teh center of the bounding box
    -set as the target of your camera (see gluLookAt) to the center of the bbox.
    -calc the angle needed for the FOV so the whole bbox can be viewed (there are various ways of doing this.

    The last step (the most complicated) is left to you, do your homework.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Dec 2007
    Posts
    1,077

    Re: view all, things that are out of the viewing volume although

    Maybe it would be easier to create a bounding sphere and find a fov for it...
    Hey coco, what's up?

    Oh, and that bounding box fov problem isn't so complicated. You got the center of the box. Then you think of a vector that starts at the viewpoint and points towards the center of the box. Take the 8 vertices of the box and calculate the angles that the vector forms with the vector that goes through the viewpoint and points towards that vertex. Take the largest angle and multiply with 2. That's the fov.

Similar Threads

  1. Viewing volume
    By Mukund in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 04-18-2010, 09:57 AM
  2. viewing volume clipping
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-14-2006, 02:18 AM
  3. clipping the viewing volume
    By IG in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-19-2006, 04:22 AM
  4. setting up the viewing volume correct
    By srikirti in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-28-2002, 12:55 AM
  5. viewing volume problem
    By ozone01 in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 11-02-2002, 11:01 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