Grouping node that defines a coordinate system for its children. More...
#include <Inventor/VRMLnodes/SoVRMLTransform.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoVRMLTransform () | |
SoVRMLTransform (int nChildren) | |
void | pointAt (const SbVec3f &fromPoint, const SbVec3f &toPoint) |
void | getScaleSpaceMatrix (SbMatrix &mat, SbMatrix &inv) const |
void | getRotationSpaceMatrix (SbMatrix &mat, SbMatrix &inv) const |
void | getTranslationSpaceMatrix (SbMatrix &mat, SbMatrix &inv) const |
void | multLeft (const SbMatrix &mat) |
void | multRight (const SbMatrix &mat) |
void | combineLeft (SoVRMLTransform *nodeOnLeft) |
void | combineRight (SoVRMLTransform *nodeOnRight) |
void | setMatrix (const SbMatrix &mat) |
void | recenter (const SbVec3f &newCenter) |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Public Attributes | |
SoSFVec3f | translation |
SoSFRotation | rotation |
SoSFVec3f | scale |
SoSFRotation | scaleOrientation |
SoSFVec3f | center |
A SoVRMLTransform is a grouping node that defines a coordinate system for its children that is relative to the coordinate systems of its parents.
NOTE: This class does not exist in Open Inventor 10.0 and later.This section may reference portions of the VRML97 specification that are not present in this help file. The complete VRML97 spec is available at http://www.web3d.org .
A SoVRMLTransform is a grouping node that defines a coordinate system for its children that is relative to the coordinate systems of its parents. See also "Concepts - Coordinate Systems and Transformations."
See the "Concepts - Grouping and Children Nodes" section for a description of the children , addChildren , and removeChildren fields and eventIns.
The bboxCenter and bboxSize fields specify a bounding box that encloses the SoVRMLTransform's children. This is a hint that may be used for optimization purposes. If the specified bounding box is smaller than the actual bounding box of the children at any time, then the results are undefined. A default bboxSize value, (-1 -1 -1), implies that the bounding box is not specified and if needed must be calculated by the browser. See "Concepts - Bounding Boxes" for a description of the bboxCenter and bboxSize fields.
The translation, rotation, scale, scaleOrientation and center fields define a geometric 3D transformation consisting of (in order) a (possibly) non-uniform scale about an arbitrary point, a rotation about an arbitrary point and axis, and a translation. The center field specifies a translation offset from the local coordinate system's origin, (0,0,0). The rotation field specifies a rotation of the coordinate system. The scale field specifies a non-uniform scale of the coordinate system - scale values must be >= 0.0. The scaleOrientation specifies a rotation of the coordinate system before the scale (to specify scales in arbitrary orientations). The scaleOrientation applies only to the scale operation. The translation field specifies a translation to the coordinate system.
Given a 3-dimensional point P and Transform node, P is transformed into point P ' in its parent's coordinate system by a series of intermediate transformations. In matrix-transformation notation, where C (center), SR (scaleOrientation), T (translation), R (rotation), and S (scale) are the equivalent transformation matrices,
P' = T x C x R x SR x S x -SR x -TC x P (where P is a column vector)
The SoVRMLTransform node:
Transform { center C rotation R scale S scaleOrientation SR translation T children [...] }
is equivalent to the nested sequence of:
Transform { translation T Transform { translation C Transform { rotation R Transform { rotation SR Transform { scale S Transform { rotation -SR Transform { translation -C ... }}}}}}}
center | 0 0 0 |
children | [] |
rotation | 0 0 1 0 |
scale | 1 1 1 |
scaleOrientation | 0 0 1 0 |
translation | 0 0 0 |
bboxCenter | 0 0 0 |
bboxSize | -1 -1 -1 |
metadata | NULL |
SoMFNode | addChildren |
SoMFNode | removeChildren |
SoSFVec3f | set_center |
SoMFNode | set_children |
SoSFRotation | set_rotation |
SoSFVec3f | set_scale |
SoSFRotation | set_scaleOrientation |
SoSFVec3f | set_translation |
SoSFNode | set_metadata |
SoSFVec3f | center_changed |
SoMFNode | children_changed |
SoSFRotation | rotation_changed |
SoSFVec3f | scale_changed |
SoSFRotation | scaleOrientation_changed |
SoSFVec3f | translation_changed |
SoSFNode | metadata_changed |
SoVRMLTransform::SoVRMLTransform | ( | ) |
Constructor.
SoVRMLTransform::SoVRMLTransform | ( | int | nChildren | ) |
Constructor that takes approximate number of children.
void SoVRMLTransform::combineLeft | ( | SoVRMLTransform * | nodeOnLeft | ) |
Same as multLeft() except that the transformation to multiply into this node comes from another transformation node.
void SoVRMLTransform::combineRight | ( | SoVRMLTransform * | nodeOnRight | ) |
Same as multRight() except that the transformation to multiply into this node comes from another transformation node.
static SoType SoVRMLTransform::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoVRMLGroup.
Returns composite matrix that transforms from object space to rotation space (the space after the scale and rotation).
Returns composite matrix that transforms from object space to scale space (the space after the scale).
Returns composite matrix that transforms from object space to translation space (the space after scale, rotation, and translation).
virtual SoType SoVRMLTransform::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoVRMLGroup.
void SoVRMLTransform::multLeft | ( | const SbMatrix & | mat | ) |
Convenience function that combines the effects of a matrix transformation into the transformation stored in this node.
This method premultiplies the transformation.
void SoVRMLTransform::multRight | ( | const SbMatrix & | mat | ) |
Convenience function that combines the effects of a matrix transformation into the transformation stored in this node.
This method postmultiplies the transformation.
Sets the transform to translate the origin to the fromPoint and rotate the negative z-axis (0,0,-1) to lie on the vector from fromPoint to toPoint.
This always tries to keep the "up" direction the positive y-axis, unless that is impossible. All current info in the node is wiped out.
void SoVRMLTransform::recenter | ( | const SbVec3f & | newCenter | ) |
Changes the center of the transformation to the given point without affecting the overall effect of the transformation.
void SoVRMLTransform::setMatrix | ( | const SbMatrix & | mat | ) |
Sets the fields in the node to implement the transformation represented by the given matrix.
Origin of scale and rotation.
Rotation.
Scale factor.
Rotational orientation for scale.
Translation vector.