Class SoTransform

All Implemented Interfaces:
SafeDisposable
Direct Known Subclasses:
SoTransformManip

public class SoTransform extends SoTransformation
General 3D geometric transformation node. This node defines 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. (While the transformations can be thought of as being applied in that order, matrices are actually premultiplied in the opposite order. Therefore, the operations are listed in the reverse order throughout this reference page.)

File format/default:

Transform {

    translation 0 0 0
    rotation 0 0 1 0
    scaleFactor 1 1 1
    scaleOrientation 0 0 1 0
    center 0 0 0
}

Action behavior:

SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoRayPickAction
Accumulates transformation into the current transformation. Sets: SoModelMatrixElement

SoGetMatrixAction
Returns the matrix corresponding to the total transformation.

See Also:
  • Field Details

    • translation

      public final SoSFVec3f translation
      Translation vector.
    • rotation

      public final SoSFRotation rotation
      Rotation specification.
    • scaleFactor

      public final SoSFVec3f scaleFactor
      Scale factors. Negative and null values may cause undesirable results.
    • scaleOrientation

      public final SoSFRotation scaleOrientation
      Rotational orientation for scale.
    • center

      public final SoSFVec3f center
      Origin for scale and rotation.
  • Constructor Details

    • SoTransform

      public SoTransform()
      Creates a transformation node with default settings.
  • Method Details

    • multLeft

      public void multLeft(SbMatrix mat)
      Convenience function that combines the effects of a matrix transformation into the current transformation stored in this node. This method premultiplies the transformation.
    • getTranslationSpaceMatrix

      public SbMatrix[] getTranslationSpaceMatrix()
      Returns composite matrix that transforms from object space to translation space (the space after scale, rotation, and translation).
    • pointAt

      public void pointAt(SbVec3f fromPoint, SbVec3f toPoint)
      Sets the node 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 field values in the node are replaced.
    • setMatrix

      public void setMatrix(SbMatrix mat)
      Sets the fields in the node to implement the transformation represented by the given matrix. Note that invalid matrices (such as singular ones) have undefined results.
    • getScaleSpaceMatrix

      public SbMatrix[] getScaleSpaceMatrix()
      Returns composite matrix that transforms from object space to scale space (the space after the scale).
    • combineRight

      public void combineRight(SoTransformation nodeOnRight)
      Convenience function that combines the effects of another transformation node into the current transformation stored in this node. This method postmultiplies the transformation.
    • multRight

      public void multRight(SbMatrix mat)
      Convenience function that combines the effects of a matrix transformation into the current transformation stored in this node. This method postmultiplies the transformation.
    • combineLeft

      public void combineLeft(SoTransformation nodeOnLeft)
      Convenience function that combines the effects of another transformation node into the current transformation stored in this node. This method premultiplies the transformation.
    • recenter

      public void recenter(SbVec3f newCenter)
      Changes the center of the transformation to the given point without affecting the overall effect of the transformation.
    • getRotationSpaceMatrix

      public SbMatrix[] getRotationSpaceMatrix()
      Returns composite matrix that transforms from object space to rotation space (the space after the scale and rotation).