I have a superclass object which represents a model in a scene. This object contains a 3D vector, position
for its location and three variables x
, y
and z
to describe its rotation around those axes. Its transformation matrix is calculated as follows:
Matrix.CreateRotationX(x) *
Matrix.CreateRotationY(y) *
Matrix.CreateRotationZ(z) *
Matrix.CreateTranslation(position)
This is all working fine, except in some circumstances I need to calculate the values for x
, y
and z
based on a normalised directional vector and an up vector. How can I do this?