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

book_4_sparkGenerated
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 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 CreateRotationX to rotate an object 45 degrees around the X-axis
float angleInDegrees = 45.0f;
Matrix rotationMatrix = Matrix.CreateRotationX(angleInDegrees);

// Use the rotationMatrix to transform a 3D object or combine with other transformations