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

robot_2Generated
code_blocksInput

Description

The 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 by scaling them in 3D space.

Usage

To use the CreateScale method, provide a Vector3 parameter that specifies 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 creating a scaling matrix
Vector3 scaleFactors = new Vector3(2.0f, 3.0f, 4.0f);
Matrix scalingMatrix = Matrix.CreateScale(scaleFactors);

// Use the scalingMatrix to transform objects
// For example, apply it to a GameObject's transform
GameObject myObject = new GameObject();
myObject.Transform = scalingMatrix * myObject.Transform;