Matrix4.Translate

Translate(Vector3)

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

public static Matrix4 Translate(Vector3 t)
ParameterTypeDescription
tVector3Translate offset

Examples

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

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

See Also


Translate(double, double, double)

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

public static Matrix4 Translate(double tx, double ty, double tz)
ParameterTypeDescription
txDoubleX-coordinate offset
tyDoubleY-coordinate offset
tzDoubleZ-coordinate offset

Examples

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

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

See Also