Description
The Rotation
property of a SceneObject
represents the orientation of the object in the scene. This rotation is relative to the object's parent, if it has one, or to the SceneWorld
if no parent is set. The rotation is defined using the Rotation
type, which typically encapsulates a quaternion or Euler angles to represent 3D rotations.
Usage
To get or set the rotation of a SceneObject
, you can use the Rotation
property. This can be useful for orienting objects in the scene, such as rotating a model to face a certain direction or to animate its rotation over time.
Example usage:
SceneObject myObject = new SceneObject();
myObject.Rotation = Rotation.FromAxis(Vector3.Up, 90); // Rotates the object 90 degrees around the up axis
Example
SceneObject myObject = new SceneObject();
myObject.Rotation = Rotation.FromAxis(Vector3.Up, 90); // Rotates the object 90 degrees around the up axis
// To read the current rotation
Rotation currentRotation = myObject.Rotation;
// To modify the rotation
myObject.Rotation *= Rotation.FromAxis(Vector3.Right, 45); // Further rotates the object 45 degrees around the right axis