SbViewVolume(3IV)

SbViewVolume (SbViewVol) - 3D viewing volume class

As shipped in IRIX 6.5.30. Added in IRIX 6.5.22.

NAME
     SbViewVolume (SbViewVol) - 3D viewing volume class

INHERITS FROM
     SbViewVolume

SYNOPSIS
     #include <Inventor_c/SbLinear.h>

     typedef SbViewVolume  SbViewVol

     enum SbViewVolumeProjectionType {
          SB_VIEW_VOL_ORTHOGRAPHIC  Orthographic projection
          SB_VIEW_VOL_PERSPECTIVE   Perspective projection
     }

          Functions from class SbViewVolume:

     SbViewVolume *      SbViewVolCreate()
     void                SbViewVolDelete(SbViewVol *this)
     void                SbViewVolGetMxs(const SbViewVol *this, SbMatrix
                              *affine, SbMatrix *proj)
     SbMatrix            SbViewVolGetMx(const SbViewVol *this)
     SbMatrix            SbViewVolGetBoxMx(const SbViewVol *this)
     void                SbViewVolProjPtToLine(const SbViewVol *this, const
                              SbVec2f *pt, SbLine *line)
     void                SbViewVolProjPtToLinePts(const SbViewVol *this, const
                              SbVec2f *pt, SbVec3f *line0, SbVec3f *line1)
     void                SbViewVolProjToScreen(const SbViewVol *this, const
                              SbVec3f *src, SbVec3f *dst)
     SbPlane             SbViewVolGetPln(const SbViewVol *this, float
                              distFromEye)
     SbVec3f             SbViewVolGetSightPt(const SbViewVol *this, float
                              distFromEye)
     SbVec3f             SbViewVolGetPlnPt(const SbViewVol *this, float
                              distFromEye, const SbVec2f *normPoint)
     SbRotation          SbViewVolGetAlignRot(const SbViewVol *this, SbBool
                              rightAngleOnly = FALSE)
     float               SbViewVolGetWorldToScreenScale(const SbViewVol *this,
                              const SbVec3f *worldCenter, float normRadius)
     SbVec2f             SbViewVolProjBox(const SbViewVol *this, const SbBox3f
                              *box)
     SbViewVolume        SbViewVolNarrow2d(const SbViewVol *this, float left,
                              float bottom, float right, float top)
     SbViewVolume        SbViewVolNarrow3d(const SbViewVol *this, const
                              SbBox3f *box)
     void                SbViewVolOrtho(SbViewVol *this, float left, float
                              right, float bottom, float top, float near,
                              float far)
     void                SbViewVolPersp(SbViewVol *this, float fovy, float
                              aspect, float near, float far)

     void                SbViewVolRotCam(SbViewVol *this, const SbRotation *q)
     void                SbViewVolXlateCam(SbViewVol *this, const SbVec3f *v)
     SbVec3f             SbViewVolZVec(const SbViewVol *this)
     SbViewVolume        SbViewVolZNarrow(const SbViewVol *this, float near,
                              float far)
     void                SbViewVolScale(SbViewVol *this, float factor)
     void                SbViewVolScaleWidth(SbViewVol *this, float ratio)
     void                SbViewVolScaleHeight(SbViewVol *this, float ratio)
     ProjectionType      SbViewVolGetProjType(const SbViewVol *this)
     const SbVec3f *     SbViewVolGetProjPt(const SbViewVol *this)
     const SbVec3f *     SbViewVolGetProjDir(const SbViewVol *this)
     float               SbViewVolGetNearDist(const SbViewVol *this)
     float               SbViewVolGetWidth(const SbViewVol *this)
     float               SbViewVolGetHeight(const SbViewVol *this)
     float               SbViewVolGetDepth(const SbViewVol *this)


DESCRIPTION
     Class used to represent a 3D viewing volume. This class is used to
     represent viewing frusta and picking volumes. For perspective projection,
     the view volume is a frustum. For orthographic (parallel) projection, the
     view volume is a rectangular prism.

FUNCTIONS
     SbViewVolume *      SbViewVolCreate()
     void                SbViewVolDelete(SbViewVol *this)
          Constructor and destructor.

     void                SbViewVolGetMxs(const SbViewVol *this, SbMatrix
                              *affine, SbMatrix *proj)
          Returns two matrices corresponding to the view volume. The first is
          a viewing matrix, which is guaranteed to be an affine
          transformation. The second is suitable for use as a projection
          matrix in OpenGL.

     SbMatrix            SbViewVolGetMx(const SbViewVol *this)
          Like the method above, but returns the affine and projection parts
          together in one matrix (i.e., affine.multRight( proj ) ).

     SbMatrix            SbViewVolGetBoxMx(const SbViewVol *this)
          Returns a matrix that transforms the view volume into camera space:
          it translates the view volume so the viewpoint is at the origin, and
          rotates it so the view direction is along the negative z axis.

     void                SbViewVolProjPtToLine(const SbViewVol *this, const
                              SbVec2f *pt, SbLine *line)
     void                SbViewVolProjPtToLinePts(const SbViewVol *this, const
                              SbVec2f *pt, SbVec3f *line0, SbVec3f *line1)
          Maps a 2D point (in 0 <= x,y <= 1) to a 3D line.

     void                SbViewVolProjToScreen(const SbViewVol *this, const
                              SbVec3f *src, SbVec3f *dst)
          Maps the 3D point in world coordinates to a 2D point in normalized
          screen coordinates (0 <= x,y,z <= 1). The z-screen coordinate
          represents the homogenized z coordinate which goes (nonlinearly)
          from 0 at the near clipping plane to 1 at the far clipping plane.

     SbPlane             SbViewVolGetPln(const SbViewVol *this, float
                              distFromEye)
          Returns a plane parallel to the near (or far) plane of the view
          volume at a given distance from the projection point (eye).

     SbVec3f             SbViewVolGetSightPt(const SbViewVol *this, float
                              distFromEye)
          Returns the point along the line of sight at the given distance from
          the projection point (eye).

     SbVec3f             SbViewVolGetPlnPt(const SbViewVol *this, float
                              distFromEye, const SbVec2f *normPoint)
          Returns the projection of a given point in normalized screen
          coordinates (see projectToScreen()) onto the plane parallel to the
          near plane that is at distFromEye units from the eye.

     SbRotation          SbViewVolGetAlignRot(const SbViewVol *this, SbBool
                              rightAngleOnly = FALSE)
          Returns a rotation that would align a viewed object so that its
          positive x-axis (of its object space) is to the right in the view
          and its positive y-axis is up. If rightAngleOnly is TRUE, it will
          come as close as it can to this goal by using only 90 degree
          rotations.

     float               SbViewVolGetWorldToScreenScale(const SbViewVol *this,
                              const SbVec3f *worldCenter, float normRadius)
          Returns a scale factor that would scale a unit sphere centered at
          worldCenter so that it would appear to have the given radius in
          normalized screen coordinates when projected onto the near plane.

     SbVec2f             SbViewVolProjBox(const SbViewVol *this, const SbBox3f
                              *box)
          Projects the given 3D bounding box onto the near plane and returns
          the size (in normalized screen coordinates) of the rectangular
          region that encloses it.

     SbViewVolume        SbViewVolNarrow2d(const SbViewVol *this, float left,
                              float bottom, float right, float top)
          Given a view volume, narrows the view to the given sub-rectangle of
          the near plane. The coordinates of the rectangle are between 0 and
          1, where (0,0) is the lower-left corner of the near plane and (1,1)
          is the upper-right corner.

     SbViewVolume        SbViewVolNarrow3d(const SbViewVol *this, const
                              SbBox3f *box)
          Narrows a view volume by the given box. The box must lie inside the
          unit cube, and the view will be shrunk according to the size of the
          box.

     void                SbViewVolOrtho(SbViewVol *this, float left, float
                              right, float bottom, float top, float near,
                              float far)
          Sets up an orthographic view volume with the given sides. The
          parameters are the same as for the OpenGL glOrtho() routine.

     void                SbViewVolPersp(SbViewVol *this, float fovy, float
                              aspect, float near, float far)
          Sets up a perspective view volume with the given field of view and
          aspect ratio. The parameters are the same as for the OpenGL
          gluPerspective() routine, except that the field of view angle is
          specified in radians.

     void                SbViewVolRotCam(SbViewVol *this, const SbRotation *q)
          Rotate the camera view direction. Note that this accomplishes the
          reverse of doing an OpenGL glRotate() command after defining a
          camera, which rotates the scene viewed by the camera.

     void                SbViewVolXlateCam(SbViewVol *this, const SbVec3f *v)
          Translate the camera viewpoint. Note that this accomplishes the
          reverse of doing an OpenGL glTranslate() command after defining a
          camera, which translates the scene viewed by the camera.

     SbVec3f             SbViewVolZVec(const SbViewVol *this)
          Returns the positive z axis in eye space. In this coordinate system,
          the z value of the near plane should be GREATER than the z value of
          the far plane.

     SbViewVolume        SbViewVolZNarrow(const SbViewVol *this, float near,
                              float far)
          Returns a narrowed view volume which contains as tightly as possible
          the given interval on the z axis (in eye space). The returned view
          volume will never be larger than the current volume, however. near
          and far are given in terms of zVector(): this means that near > far
          must hold.

     void                SbViewVolScale(SbViewVol *this, float factor)
          Scales width and height of view volume by given factor.

     void                SbViewVolScaleWidth(SbViewVol *this, float ratio)
     void                SbViewVolScaleHeight(SbViewVol *this, float ratio)
          Scales view volume to be the given ratio of its current width or
          height, leaving the resulting view volume centered about the same
          point (in the near plane) as the current one.

     ProjectionType      SbViewVolGetProjType(const SbViewVol *this)
     const SbVec3f *     SbViewVolGetProjPt(const SbViewVol *this)
     const SbVec3f *     SbViewVolGetProjDir(const SbViewVol *this)
          Returns projection information.

     float               SbViewVolGetNearDist(const SbViewVol *this)
          Returns distance from projection point to near plane.

     float               SbViewVolGetWidth(const SbViewVol *this)
     float               SbViewVolGetHeight(const SbViewVol *this)
     float               SbViewVolGetDepth(const SbViewVol *this)
          Returns bounds of viewing frustum.


FILE FORMAT/DEFAULTS
     ViewVolume {
     }

SEE ALSO
     SbVec3f, SbVec2f, SbBox3f, SbMatrix, SbRotation