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

book_4_sparkGenerated
code_blocksInput

Description

The Matrix.CreateRotationX method creates 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 around the X-axis.

Usage

To use the CreateRotationX method, call it with a single parameter representing the angle in degrees by which you want to rotate around the X-axis. The method returns a Matrix object representing the rotation.

Example

// Example of using Matrix.CreateRotationX
float angleInDegrees = 45.0f;
Matrix rotationMatrix = Matrix.CreateRotationX(angleInDegrees);

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