osg.Transform¶
- class osg.Transform¶
- Represents
c++ class
- Wraps
osg::Transform
- Bases
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
osg.MatrixTransform
andosg.PositionAttitudeTransform
support the use of anosg.Matrix
or aosg.Vec3
andosg.Quat
respectively. 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 eitherGLenum.GL_NORMALIZE
and GL_RESCALE_NORMAL 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 localosg.StateSet
to theosg.Transform
, and set the appropriate mode to ON viaosg.StateSet.setMode()
call with argumentsGLenum.GL_NORMALIZE
andosg.StateAttribute.ON
.Constructors:
- osg.Transform()¶
Methods:
- :asMatrixTransform()¶
-
- Тип результата
- :asPositionAttitudeTransform()¶
-
- Тип результата
- :asAutoTransform()¶
-
- Тип результата
- :setReferenceFrame(osg.Transform.ReferenceFrame rf)¶
Set the transform’s ReferenceFrame, either to be relative to its parent reference frame, or relative to an absolute coordinate frame.
osg.Transform.RELATIVE_RF
is the default. Note: Setting the ReferenceFrame to beosg.Transform.ABSOLUTE_RF
will also set the CullingActive flag on the transform, and hence all of its parents, tofalse
, thereby disabling culling of it and all its parents. This is necessary to prevent inappropriate culling, but may impact cull times if the absolute transform is deep in the scene graph. It is therefore recommended to only use absolute Transforms at the top of the scene, for such things as heads up displays.osg.Transform.ABSOLUTE_RF_INHERIT_VIEWPOINT
is the same asosg.Transform.ABSOLUTE_RF
except it adds the ability to use the parents view points position in world coordinates as its local viewpoint in the new coordinates frame. This is useful for Render to texture Cameras that wish to use the main views LOD range computation (which uses the viewpoint rather than the eye point) rather than use the local eye point defined by the this Transforms“ absolute view matrix.- Параметры
rf (
osg.Transform.ReferenceFrame
) –
- :getReferenceFrame()¶
-
- Тип результата