Matrix4.Rotate
Contents
[
Hide
]Rotate(double, Vector3)
Create a rotation matrix by rotation angle and axis
public static Matrix4 Rotate(double angle, Vector3 axis)
Parameter | Type | Description |
---|---|---|
angle | Double | Rotate angle in radian |
axis | Vector3 | Rotation axis |
Examples
The following code shows how to create a matrix for rotate operation.
var t = Matrix4.Rotate(Math.PI, new Vector3(0, 1, 0));
var pos = new Vector3(1, 1, 10);
Console.WriteLine($"Transformed: {t * pos}");
See Also
- struct Vector3
- struct Matrix4
- namespace Aspose.ThreeD.Utilities
- assembly Aspose.3D
Rotate(Quaternion)
Create a rotation matrix from a quaternion
public static Matrix4 Rotate(Quaternion q)
Parameter | Type | Description |
---|---|---|
q | Quaternion | Rotation quaternion |
Examples
The following code shows how to create a matrix for rotate operation.
var t = Matrix4.Rotate(Quaternion.FromAngleAxis(Math.PI, Vector3.YAxis));
var pos = new Vector3(1, 1, 10);
Console.WriteLine($"Transformed: {t * pos}");
See Also
- struct Quaternion
- struct Matrix4
- namespace Aspose.ThreeD.Utilities
- assembly Aspose.3D