I multiply a 4 x 4 matrix by a 4 component vector, and I'm trying to find the value of the z component working backwards. The following picture is just to show you what I'm talking about.
After doing this multiplication then z is divided by w, which as you can see always ends up being negative z. Before multiplying the w component is ALWAYS 1.
The final result I get we'll call "d". Now I try to write an equation which shows this, and I get:
Then I simplify this to:
I would like to know if this is solvable for z. Every time I try I end up getting something like z over z on one side. I'm not good at math at all, this is my attempt:
First simplify a little:
Multiply both sides by "f - n"
There are many different different ways I've tried it, in one case I got a solution which was:
But it didn't work out. I mean the image didn't display the correct depth value. I'd appreciate any help.