user8670849
user8670849

Reputation:

OpenTk rotations matrices

What is difference between the two rotation matrices? I do not understand why the result is different between rotationxyz and rotxyz?

Matrix4 rotationXYZ = Matrix4.CreateRotationX(5) * Matrix4.CreateRotationY(5) * Matrix4.CreateRotationZ(5);
Matrix4 rotXYZ = Matrix4.Identity;
Matrix4.CreateRotationX(5, out rotXYZ);
Matrix4.CreateRotationY(5, out rotXYZ);
Matrix4.CreateRotationZ(5, out rotXYZ);`

Upvotes: 0

Views: 149

Answers (1)

Andrey Trusov
Andrey Trusov

Reputation: 11

The method Matrix4.CreateRotation#(5, out rotXYZ) build new rotXYZ matrix. I.e. you three times overwrite rotXYZ.

Upvotes: 1

Related Questions