SOTRANSFORM(3iv)

πŸŽ€ NAME πŸŽ€

SoTransform β€” general 3D geometric transformation node πŸ’…


🧬 INHERITS FROM 🧬

SoBase > SoFieldContainer > SoNode > SoTransformation > SoTransform


πŸ“œ SYNOPSIS πŸ“œ

bestie you gotta pull the header in first, no cap:

#include <Inventor/nodes/SoTransform.h>

✨ Fields from class SoTransform ✨

  • SoSFVec3f translation
  • SoSFRotation rotation
  • SoSFVec3f scaleFactor
  • SoSFRotation scaleOrientation
  • SoSFVec3f center

πŸ’– Methods from class SoTransform πŸ’–

  • SoTransform()
  • 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(SoTransformation *nodeOnRight)
  • void combineRight(SoTransformation *nodeOnLeft)
  • void setMatrix(const SbMatrix &mat)
  • void recenter(const SbVec3f &newCenter)
  • static SoType getClassTypeId()

🌸 Methods from class SoNode 🌸

  • void setOverride(SbBool state)
  • SbBool isOverride() const
  • SoNode * copy(SbBool copyConnections = FALSE) const
  • virtual SbBool affectsState() const
  • static SoNode * getByName(const SbName &name)
  • static int getByName(const SbName &name, SoNodeList &list)

πŸ¦‹ Methods from class SoFieldContainer πŸ¦‹

  • void setToDefaults()
  • SbBool hasDefaultValues() const
  • SbBool fieldsAreEqual(const SoFieldContainer *fc) const
  • void copyFieldValues(const SoFieldContainer *fc, SbBool copyConnections = FALSE)
  • SbBool set(const char *fieldDataString)
  • void get(SbString &fieldDataString)
  • virtual int getFields(SoFieldList &resultList) const
  • virtual SoField * getField(const SbName &fieldName) const
  • SbBool getFieldName(const SoField *field, SbName &fieldName) const
  • SbBool isNotifyEnabled() const
  • SbBool enableNotify(SbBool flag)

πŸ’œ Methods from class SoBase πŸ’œ

  • void ref()
  • void unref() const
  • void unrefNoDelete() const
  • void touch()
  • virtual SoType getTypeId() const
  • SbBool isOfType(SoType type) const
  • virtual void setName(const SbName &name)
  • virtual SbName getName() const

πŸ’« DESCRIPTION πŸ’«

okay so picture this: this node defines a geometric 3D transformation, and it's built from three things, in this order:

  1. a (possibly) non-uniform scale about an arbitrary point,
  2. a rotation</> about an arbitrary point and axis,
  3. and a translation.

that's the vibe. BUT β€” and this is the plot twist β€” even though you can think of the transformations as being applied in that order, the matrices are actually premultiplied in the opposite order. 😭 so, because of that, throughout this whole reference page the operations are listed in reverse order. it's giving "trust the process". iykyk. 🫢


πŸ“ FIELDS πŸ“

  • SoSFVec3f translation β€” the translation vector, aka "where are we sliding to" πŸ’«
  • SoSFRotation rotation β€” the rotation spec, the whole spin situation 🌈
  • SoSFVec3f scaleFactor β€” the scale factors, how big/smol we're going ✨
  • SoSFRotation scaleOrientation β€” the rotational orientation for the scale, i.e. which way the stretch is pointing πŸŽ€
  • SoSFVec3f center β€” the origin for both the scale and the rotation, the main character point πŸ‘‘

πŸ’… METHODS πŸ’…

  • SoTransform() β€” creates a transformation node with default settings. fresh out the box, defaults only, iconic. ✨
  • void pointAt(const SbVec3f &fromPoint, const SbVec3f &toPoint) β€” sets the node so it translates the origin to fromPoint and rotates the negative z-axis (0,0,-1) so it lies on the vector going from fromPoint to toPoint. it always tries to keep the "up" direction as the positive y-axis, unless that's impossible. and heads up bestie: all current field values in the node get replaced. πŸ™ˆ not a merge, a full swap.
  • void getScaleSpaceMatrix(SbMatrix &mat, SbMatrix &inv) const
  • void getRotationSpaceMatrix(SbMatrix &mat, SbMatrix &inv) const
  • void getTranslationSpaceMatrix(SbMatrix &mat, SbMatrix &inv) const

these three return composite matrices that transform from object space into each of the spaces after the scale, the rotation, or the translation. literally the backstage pass to each stage of the pipeline. 🎟️

  • void multLeft(const SbMatrix &mat)
  • void multRight(const SbMatrix &mat)

convenience functions that fold the effects of a matrix transformation into the current transformation stored in this node. the first one premultiplies the transformation, the second one postmultiplies it. left vs right, choose your fighter. πŸ’€

  • void combineLeft(SoTransformation *nodeOnRight)
  • void combineRight(SoTransformation *nodeOnLeft)

same energy, but with another transformation node instead of a matrix β€” they combine that node's effects into the current transformation stored in this node. first one premultiplies, second one postmultiplies. 🫢

  • void setMatrix(const SbMatrix &mat) β€” sets the fields in the node so they implement the transformation represented by the given matrix. > ⚠️ warning bestie: invalid matrices (like singular ones) have undefined results. that's the "we don't know her" zone, don't go there. 😭
  • void recenter(const SbVec3f &newCenter) β€” changes the center of the transformation to the given point without affecting the overall effect of the transformation. glow-up with zero side effects, slay. πŸ’–
  • static SoType getClassTypeId() β€” returns the type identifier for this class. the ID card. πŸ‘‘

πŸ”₯ ACTION BEHAVIOR πŸ”₯

  • SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoRayPickAction β€” accumulates the transformation into the current transformation. stacking it up, one on top of the other. ✨
  • SoGetMatrixAction β€” returns the matrix corresponding to the total transformation. the receipts. 🧾

🌈 FILE FORMAT/DEFAULTS 🌈

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

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, they're all in the group chat:

  • SoMatrixTransform
  • SoResetTransform
  • SoRotation
  • SoRotationXYZ
  • SoScale
  • SoTransformManip
  • SoTransformSeparator
  • SoTranslation

and that's the whole page bestie!! πŸŽ€ this was the SoTransform(3IV) manual page β€” the header and the footer both just say SoTransform(3IV)(), so the source/version-and-date stamp down there is literally empty, no notes, no date, just vibes. πŸ’œβœ¨ periodt.