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 4 of 4

Thread: OpenInventor: OpenGL calls invisible when far from IV objects

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2004
    Posts
    3

    OpenInventor: OpenGL calls invisible when far from IV objects

    Hi,

    I have another small problem-question(I think its the last one) about including OpenGL calls with OpenInventor technology. I noticed this a long ago that when drawing OpenGL call in an SoPerspectiveCamera scene, the vertex which are far from the OpenInventor camera aren't shown on the screen. This problem does not exist for the Ortho view. The problem seems to be with a Near and Far value limits.

    A video with the problem is available here at: http://www.netchilds.com/Louis/glCal...iveCamera.mpeg

    In the video you can see that when you add the grid(which is all OpenInventor objects), the lines(in OpenGL) are shown correctly in the 3d view. When you dont, the camera cut the lines. There is no problem for the Ortho X,Y,Z views. I include the code below for the OpenGL white lines in the video.

    Do you know why OpenInventor with SoPerspectiveCamera doesn't render all the OpenGL scene all the time without needing OpenInventor objects at each limits?

    Thank you for your help,
    Louis-Charles Dumais

    Here is the code:
    glDrawAxes(){

    glLineWidth(5.0f);
    glColor3f(1.0f,1.0f,1.0f);
    float tempLength= 5.0f;
    glBegin(GL_LINES);
    glVertex3f( -tempLength,0.0f, 0.0f);glVertex3f(tempLength,0.0f, 0.0f);
    glVertex3f( 0.0f,-tempLength, 0.0f);glVertex3f(0.0f,tempLength, 0.0f);
    glVertex3f( 0.0f,0.0f, -tempLength);glVertex3f(0.0f,0.0f, tempLength);
    glEnd();

    }

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    857

    Re: OpenInventor: OpenGL calls invisible when far from IV objects

    Please post questions like these in the "high-level toolkits" forum.

    -- Tom

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jan 2001
    Location
    Lafayette, LA
    Posts
    138

    Re: OpenInventor: OpenGL calls invisible when far from IV objects

    Do you know why OpenInventor with SoPerspectiveCamera doesn't render all the OpenGL scene all the time without needing OpenInventor objects at each limits?
    Sounds like your version of OI tries to optimize the use of the Z-Buffer by closely fitting the viewing frustum around the scene. There might be an option to turn that off, or you could just turn your grid into an OI object.

    Hope it helps

    Dirk

  4. #4
    Junior Member Newbie
    Join Date
    Jan 2005
    Location
    San Diego, CA
    Posts
    20

    Re: OpenInventor: OpenGL calls invisible when far from IV objects

    Originally posted by dirk:
    Do you know why OpenInventor with SoPerspectiveCamera doesn't render all the OpenGL scene all the time without needing OpenInventor objects at each limits?
    Sounds like your version of OI tries to optimize the use of the Z-Buffer by closely fitting the viewing frustum around the scene. There might be an option to turn that off, or you could just turn your grid into an OI object.
    As far as I know, all versions of OI try to optimize the Z-buffer depth range by automatically re-computing the near and far clip planes on each render traversal. There is an option to turn that off (see SoXtViewer setAutoClipping) but generally it's a useful feature.

    The clip plane computation depends on what OI thinks is the bounding box of the scene graph. So a better solution is to correctly report the bounding box of your OpenGL geometry. You can do this in a custom node by implementing the computeBBox method or in a SoCallback's callback function by checking if the action is SoGetBoundingBoxAction and extending the bbox in the current state.

    -Mike

Posting Permissions

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