# Projection Matrix

This topic is 3653 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Does anybody know of a good book or tutorial that explains the how the projection matrix is derived? Im reading about it in frank lunas book, but im having some trouble understanding some parts of it. I understand the X and Y projection fine, but the Z calculation is confusing me. He comes up with the formula, Uz + V, to normalize the z values Un + V = 0 //near Uf + V = 1 //far but where does that Uz + V, formula come from? He then says that he will use U + v/z instead because of the divide by w after the matrix multiplication, how does he come to this formula? is it becuase: 1/w * Uz + V = Uz/w + V/w = Uz/z + V/z = U + V/z Thus you just use that instead? I also niticed that with Uz + V, you can map negative near planes and positive far planes to 0-1, but with U + v/z, you cant, it doesnt work, why is this? Not that you would ever have a negative near plane. And finally, how did they determine where to place the z normalisation components in the matrix? Was the goal to just find a place so that the final outcome was

f           fn
---   -    -------
f-n        z(f - n)

for the z compoent of the vector?

zf          fn
---   -    -------
f-n        (f - n)

after the matrix multiplication

zf           fn                         f           fn
---   -    -------         ------->      ---   -    -------
zf-n        z(f - n)                     f-n        z(f - n)

after the divide by w
which was the formula for U + v/z



##### Share on other sites
You do indeed sound a bit confused :) But then again the perspective projection matrix can be quiet confusing at times - Especially if you fully understand the reasons for it being as it is. You'll have to factor in that there doesn't exist one projection matrix, but a number of different ones which solve different problems. Don't have to much time atm so can't really get into the details now but whenever I'm in doubt I tend to read Projection matrices which gives a good oversight on the different projection matrices.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 14
• 14
• 45
• 22
• 27
• ### Forum Statistics

• Total Topics
634044
• Total Posts
3015211
×