#include <Inventor/SbLinear.h>
Public Types | |
enum | ProjectionType { ORTHOGRAPHIC = 0, PERSPECTIVE = 1 } |
Public Methods | |
SbViewVolume (void) | |
~SbViewVolume (void) | |
void | getMatrices (SbMatrix &affine, SbMatrix &proj) const |
SbMatrix | getMatrix (void) const |
SbMatrix | getCameraSpaceMatrix (void) const |
void | projectPointToLine (const SbVec2f &pt, SbLine &line) const |
void | projectPointToLine (const SbVec2f &pt, SbVec3f &line0, SbVec3f &line1) const |
void | projectToScreen (const SbVec3f &src, SbVec3f &dst) const |
SbPlane | getPlane (const float distFromEye) const |
SbVec3f | getSightPoint (const float distFromEye) const |
SbVec3f | getPlanePoint (const float distFromEye, const SbVec2f &normPoint) const |
SbRotation | getAlignRotation (SbBool rightAngleOnly=FALSE) const |
float | getWorldToScreenScale (const SbVec3f &worldCenter, float normRadius) const |
SbVec2f | projectBox (const SbBox3f &box) const |
SbViewVolume | narrow (float left, float bottom, float right, float top) const |
SbViewVolume | narrow (const SbBox3f &box) const |
void | ortho (float left, float right, float bottom, float top, float nearval, float farval) |
void | perspective (float fovy, float aspect, float nearval, float farval) |
void | rotateCamera (const SbRotation &q) |
void | translateCamera (const SbVec3f &v) |
SbVec3f | zVector (void) const |
SbViewVolume | zNarrow (float nearval, float farval) const |
void | scale (float factor) |
void | scaleWidth (float ratio) |
void | scaleHeight (float ratio) |
ProjectionType | getProjectionType (void) const |
const SbVec3f & | getProjectionPoint (void) const |
const SbVec3f & | getProjectionDirection (void) const |
float | getNearDist (void) const |
float | getWidth (void) const |
float | getHeight (void) const |
float | getDepth (void) const |
void | print (FILE *fp) const |
void | getViewVolumePlanes (SbPlane planes[6]) const |
void | transform (const SbMatrix &matrix) |
SbVec3f | getViewUp (void) const |
Public Attributes | |
ProjectionType | type |
SbVec3f | projPoint |
SbVec3f | projDir |
float | nearDist |
float | nearToFar |
SbVec3f | llf |
SbVec3f | lrf |
SbVec3f | ulf |
This class contains the necessary information for storing a view volume. It has methods for projection of primitives from or into the 3D volume, doing camera transforms, view volume transforms etc.
|
An SbViewVolume instance can represent either an orthogonal projection volume or a perspective projection volume.
|
|
Constructor. Note that the SbViewVolume instance will be uninitialized until you explicitly call ortho() or perspective().
|
|
Destructor. |
|
Returns the view volume's affine matrix and projection matrix.
|
|
Returns the combined affine and projection matrix.
|
|
Returns a matrix which will translate the view volume camera back to origo, and rotate the camera so it'll point along the negative z axis. Note that the matrix will not include the rotation necessary to make the camera up vector point along the positive y axis (i.e. camera roll is not accounted for).
|
|
Project the given 2D point from the projection plane into a 3D line. pt coordinates should be normalized to be within [0, 1]. |
|
Project the given 2D point from the projection plane into two points defining a 3D line. The first point, line0, will be the corresponding point for the projection on the near plane, while line1 will be the line endpoint, lying in the far plane. |
|
Project the src point to a normalized set of screen coordinates in the projection plane and place the result in dst. It is safe to let src and \dst be the same SbVec3f instance. The z-coordinate of dst is monotonically increasing for points closer to the far plane. Note however that this is not a linear relationship, the dst z-coordinate is calculated as follows: Orthogonal view: DSTz = (-2 * SRCz - far - near) / (far - near), Perspective view: DSTz = (-SRCz * (far - near) - 2*far*near) / (far - near) |
|
Returns an SbPlane instance which has a normal vector in the opposite direction of which the camera is pointing. This means the plane will be parallel to the near and far clipping planes.
|
|
Returns the point on the center line-of-sight from the camera position with the given distance.
|
|
Return the 3D point which projects to normPoint and lies on the plane perpendicular to the camera direction and distFromEye distance away from the camera position. normPoint should be given in normalized coordinates, where the visible render canvas is covered by the range [0.0, 1.0]. |
|
This method is obsoleted in Coin. Let us know if you need it, and we'll consider implementing it. |
|
Given a sphere with center in worldCenter and an initial radius of 1.0, return the scale factor needed to make this sphere have a normRadius radius when projected onto the near clipping plane. |
|
Projects the given box onto the projection plane and returns the normalized screen space it occupies. |
|
Returns a narrowed version of the view volume which is within the given [0, 1] normalized coordinates. The coordinates are taken to be corner points of a normalized "view window" on the near clipping plane. I.e.:
SbViewVolume view; view.ortho(0, 100, 0, 100, 0.1, 1000); view = view.narrow(0.25, 0.5, 0.75, 1.0); ..will give a view volume with corner points <25, 75> and <50, 100>.
|
|
Returns a narrowed version of the view volume which is within the given [0, 1] normalized coordinates. The box x and y coordinates are taken to be corner points of a normalized "view window" on the near clipping plane. The box z coordinates are used to adjust the near and far clipping planes, and should be relative to the current clipping planes. A value of 1.0 is at the current near plane. A value of 0.0 is at the current far plane. |
|
Set up the view volume as a rectangular box for orthographic parallel projections. The line of sight will be along the negative z axis, through the center of the plane defined by the point <(right+left)/2, (top+bottom)/2, 0>.
|
|
Set up the view volume for perspective projections. The line of sight will be through origo along the negative z axis.
|
|
Rotate the direction which the camera is pointing in.
|
|
Translate the camera position of the view volume.
|
|
Return the vector pointing from the center of the view volume towards the camera. This is just the vector pointing in the opposite direction of getProjectionDirection().
|
|
Return a copy SbViewVolume with narrowed depth by supplying parameters for new near and far clipping planes. nearval and \farval should be relative to the current clipping planes. A value of 1.0 is at the current near plane. A value of 0.0 is at the current far plane.
|
|
Scale width and height of viewing frustum by the given ratio around the projection plane center axis.
|
|
Scale width of viewing frustum by the given ratio around the vertical center axis in the projection plane.
|
|
Scale height of viewing frustum by the given ratio around the horizontal center axis in the projection plane.
|
|
Return current view volume projection type, which can be either ORTHOGRAPHIC or PERSPECTIVE.
|
|
Returns coordinates of center point in the projection plane. |
|
Returns the direction of projection, i.e. the direction the camera is pointing.
|
|
Returns distance from projection plane to near clipping plane.
|
|
Returns width of viewing frustum in the projection plane.
|
|
Returns height of viewing frustum in the projection plane.
|
|
Returns depth of viewing frustum, i.e. the distance from the near clipping plane to the far clipping plane.
|
|
Dump the state of this object to the file stream. Only works in debug version of library, method does nothing in an optimized compile. |
|
Returns the six planes defining the view volume in the following order: left, bottom, right, top, near, far. Plane normals are directed into the view volume. This method is an extension for Coin, and is not available in the original Open Inventor. |
|
Transform the viewing volume by matrix. |
|
Returns the view up vector for this view volume. It's a vector which is perpendicular to the projection direction, and parallel and oriented in the same direction as the vector from the lower left corner to the upper left corner of the near plane. |
|
For internal use only. |
|
For internal use only. |
|
For internal use only. |
|
For internal use only. |
|
For internal use only. |
|
For internal use only. |
|
For internal use only. |
|
For internal use only. |