I had a question up on stackoverflow where a user and myself were able to dig through an issue, and determined it must be an issue with either how I am transposing my matrices, or multiplying them.
To summarize the problem I'm having, I can set a model at a fixed z position without any problem by setting the actual model origin z coordinate value to any non-zero value, and this works, however, if I try to create a model with with an origin of [0,0,0] and use a model matrix to transform it, I can transform the x and y coordinates with no problems, but if my z value is not between 0.0f and -0.9999f it just disappears. pivotnig (the user that was helping me on stackoverflow) had suggested it may be a matrix multiplication order issue, so I tried reversing the order, and just experimenting with different orderings, which mostly just made my scene disappear.
To jump back an idea for a second, another suspicion was that I maybe shouldn't be transposing the matrices before sending them to the vertex shader. The reason I am is because every example I have came across on msdn and some other places have always sent the matrices to the vertex shader after a XMMatrixTranspose().
Another thing that I haven't tried because I do not have a great understanding of it is using the camera's inverse matrix. I noticed that some samples I looked at used it, but some did not. I don't know if the issue resides in the camera matrix, however, because while running the application, I can move the camera without any problems, and the scene seems to response appropriately in terms of distance and projection.
I have no found any other person with a similar issue in DirectX 11, and any similar issues otherwise are with versions of DirectX where the matrices were managed internally.
For the sake of convenience, here are my code snippets that I'm possibly having trouble with - I can upload other snippets if anyone thinks the problem is elsewhere.
- Transform matrix class (model/world), Universe class (manages camera, projection, and a single transform matrix), and my vertex shader.
- My camera class.
I'll admit that I'm not particularly skilled in 3d math, so if anyone has a very mathy answer, can you try and simplify it as much as possible for me please.