Matrix4.Scale

Scale(Vector3)

Creates a matrix that scales along the x-axis, the y-axis and the z-axis.

public static Matrix4 Scale(Vector3 s)
ParameterTypeDescription
sVector3Scaling factories applies to the x-axis, the y-axis and the z-axis

Examples

The following code shows how to create a matrix for scale operation.

var t = Matrix4.Scale(new Vector3(10, 10, 10));
var pos = new Vector3(1, 1, 10);
Console.WriteLine($"Transformed: {t * pos}");

See Also


Scale(double)

Creates a matrix that scales along the x-axis, the y-axis and the z-axis.

public static Matrix4 Scale(double s)
ParameterTypeDescription
sDoubleScaling factories applies to all axex

Examples

The following code shows how to create a matrix for scale operation.

var t = Matrix4.Scale(10);
var pos = new Vector3(1, 1, 10);
Console.WriteLine($"Transformed: {t * pos}");

See Also


Scale(double, double, double)

Creates a matrix that scales along the x-axis, the y-axis and the z-axis.

public static Matrix4 Scale(double sx, double sy, double sz)
ParameterTypeDescription
sxDoubleScaling factories applies to the x-axis
syDoubleScaling factories applies to the y-axis
szDoubleScaling factories applies to the z-axis

Examples

The following code shows how to create a matrix for scale operation.

var t = Matrix4.Scale(10, 20, 10);
var pos = new Vector3(1, 1, 10);
Console.WriteLine($"Transformed: {t * pos}");

See Also