I am doing a behind the curtains 3d simulation while rendering the world in my 2d isometric engine. I've never done an isometric engine before, and my matrix math is rusty in general so I am having problems.
I have a projection matrix, which in its simplest form is this:
0.7 0.35 0
0 -0.87 0
-0.71 0.35 1
A couple of signs are flipped because my engines coordinate system is 0,0 in the top left, with +X to the right/east and +Z to the south.
Now, the inverse of that is:
1.4080 0.5670 0.0000
0.0000 -1.1490 0.0000
1.0000 0.8050 1.0000
Now, these matrices mostly work.
For instance
WC: 500,0,500 = Screen: -1.44, 350, 500 (X and Y are correct)
WC: 0,0,500 = Screen: -355, 175, 500 (X and Y are correct again)
But, now if you need to go the other way, you no longer have that handy Z value, so
Screen: -1.44, 350, 0 = WC: -2, -402.97, 0 (So, garbage.)
And lots more - as soon as I no longer have that Z value, I can't retrieve the world coords from the screen coords.
What's the workaround here?
EDIT
I should point out that the point of the unproject is to get a ray for mouse picking..
It seems like it's just my misperception of what I was doing that was screwing me up here.