static Matrix CreateRotationX( float degrees )
static Matrix CreateRotationX( float degrees, Vector3 center )

robot_2Generated
code_blocksInput

Description

The CreateRotationX method generates a rotation matrix that rotates around the X-axis by a specified angle in degrees. This method is useful for transforming 3D objects in a scene by applying a rotation about the X-axis.

Usage

To use the CreateRotationX method, call it with a single parameter representing the angle of rotation in degrees. The method returns a Matrix object that can be used to transform 3D objects.

Example

// Example of creating a rotation matrix around the X-axis
float angleInDegrees = 45.0f;
Matrix rotationMatrix = Matrix.CreateRotationX(angleInDegrees);

// Use the rotation matrix to transform a vector or apply to an object
Vector3 originalVector = new Vector3(1, 0, 0);
Vector3 transformedVector = rotationMatrix.Transform(originalVector);