I'm having some serious trouble understanding the view matrix in XNA. I've come pretty far with all the other parts and since I've just learnt myself the required maths I don't want to use the built in Matrix-functions without understanding what they do first.
Now I understand the basics of rotation, projection and translation but I can't for the life of me understand how the view matrix works in XNA.
From what I've gathered, the view matrix should transform the "world" to it's own space. Seems reasonable, but the Matrix.CreateLookAt method in the library is quite puzzling.
I've established (through examining what the library function outputs) that these two pieces of code yield the same results:
Matrix view = Matrix.CreateReflection(new Plane(Vector3.UnitX, 0)) * Matrix.CreateReflection(new Plane(Vector3.UnitZ, 0)) * Matrix.CreateTranslation(Position);
// ..equals this if (Position = (0 0 -5), since LookAt "looks at" but the above just looks straight down Z)..
Matrix blah = Matrix.CreateLookAt(Position, Vector3.Zero, Vector3.UnitY);
Why flip the X and Z axes? I thought you should rotate the world according to the cameras rotation, but in the opposite direction, and then translate the world by the same amount in the opposite direction.
Or is the view matrix not used as a transformation at all but just encodes the position and rotation of the camera in the world?