static Matrix CreateScale( Vector3 scales )
static Matrix CreateScale( Vector3 scales, Vector3 centerPoint )

book_4_sparkGenerated
code_blocksInput

Description

The Matrix.CreateScale method generates a scaling matrix based on the specified scale factors for the x, y, and z axes. This method is useful for transforming objects in 3D space by scaling them according to the provided vector.

Usage

To use the CreateScale method, pass a Vector3 object that contains the scale factors for each axis. The method returns a Matrix that can be used to scale objects in a 3D scene.

Example

// Example of using Matrix.CreateScale
Vector3 scaleFactors = new Vector3(2.0f, 3.0f, 4.0f);
Matrix scaleMatrix = Matrix.CreateScale(scaleFactors);

// Use the scaleMatrix to transform a 3D object
// For example, apply it to a model's transformation matrix