Matrix bug?

When I have a view Matrix that is created using Matrix.CreateLookAt(new Vector3(3,4,0),Vector3.Zero,Vector.Up)

it creates a handy view Matrix all well and good - that isn’t the issue though, the issue is the Matrix.forward, Matrix.up, Matrix.right etc is getting the wrong vectors

I know the Matrix itself isn’t broken because everything draws just fine - I went into the source on github and compared which matrix elements are set by the calculations in CreateLookAt to those that are returned by the get/set for the orientation vectors - the orientation vectors are as if the matrix is transposed

Is this a bug or am I just using those unit vectors as something they aren’t intended to be used as - camera orientation vectors

Matrix.CreateLookAt creates a view matrix for a camera, i.e. a matrix that transforms objects from world space to view space. The properties Matrix.Forward, Matrix.Up, Matrix.Right make little sense in this case.

The properties make sense when you create a world matrix, i.e. a matrix that transforms an object from local space to world space. In this case Matrix.Forward, Matrix.Up, Matrix.Right work as expected.

Example: You position an airplane in world space. When you read Matrix.Forward of its world matrix, you get the direction in which it is moving.

Note: You can use Matrix.CreateLookAt to position an object in world space, but in this case you need to invert the result. (The world matrix of a camera is the inverse of the view matrix.)