The RotateAroundAxis
method allows you to rotate a Rotation
instance around a specified axis by a given number of degrees. This method modifies the current rotation by applying an additional rotation around the provided axis.
The RotateAroundAxis
method allows you to rotate a Rotation
instance around a specified axis by a given number of degrees. This method modifies the current rotation by applying an additional rotation around the provided axis.
To use the RotateAroundAxis
method, you need to have an instance of the Rotation
struct. Call this method on the instance, passing in the axis of rotation as a Vector3
and the angle in degrees as a float
.
// Create a rotation instance Rotation rotation = Rotation.Identity; // Define the axis of rotation Vector3 axis = new Vector3(0, 1, 0); // Y-axis // Define the angle of rotation in degrees float degrees = 90.0f; // Rotate the rotation around the specified axis rotation = rotation.RotateAroundAxis(axis, degrees); // The rotation is now rotated 90 degrees around the Y-axis