A Transform is a group node for which all children are transformed by a 4x4 matrix.
A Transform is a group node for which all children are transformed by a 4x4 matrix. It is often used for positioning objects within a scene, producing trackball functionality or for animation.Transform itself does not provide set/get functions, only the interface for defining what the 4x4 transformation is. Subclasses, such as MatrixTransform and PositionAttitudeTransform support the use of an osg::Matrix or a osg::Vec3/osg::Quat resprectively. The Transform node can be customized via the ComputeTransfromCallback which can be attached to the node. This might be used to convert from internal representations of the transformation into generic osg::Matrix objects which are used during scene grpah traversal, such as CullTraversal and IntersectionTraversal.
Note: if the transformation matrix scales the subgraph then the normals of the underlying geometry will need to be renormalized to be unit vectors once more. This can be done transparently through OpenGL's use of either GL_NORMALIZE and GL_SCALE_NORMALIZE modes. For further background reading see the glNormalize documentation in the OpenGL Reference Guide (the blue book). To enable it in the OSG, you simply need to attach a local osg::StateSet to the osg::Transform, and set the appropriate mode to ON via stateset->setMode(GL_NORMALIZE, osg::StateAttribute::ON);
Alphabetic index HTML hierarchy of classes or Java