Help with projection matrix (again :) )
Posted: November 16th, 2019, 10:24 pm
Ok, it seems I am still missing some fundamental part of full understanding of the projection matrix.
For starters, I have watched Chili's 3D fundamentals video on the subject, and have also read many good book's take on it.
It is the pre-perspective divide parts that are giving me trouble, so this question is gonna be the same for both perspective and orthographic projections.
Ok, I'm basically gonna step through the math here for just the x coordinate. Please tell me where I get things wrong.
Let's arbitrarily decide that in viewspace , the left edge is 30, and the right edge is 60. I purposely using fairly random numbers here, because it may help expose where I'm wrong on matters.
Let's say the FOV is 100°.
In the matrix Chili, and all my books show, x is multiplied by:
2n/right-left.
Using 1/tan(FOV/2), I get an n of .84
2*.84 is 1.68
1.68/(60-30) is .056.
Thus, the value in [0][0] of the matrix will be .056
Let's say my coordinate to be transformed is at x=45 in viewspace.
It should map to 0 in NDC space.
.056*45 is 2.52. Clearly I'm missing something.
What's weird to me, is that in my books, they usually start out with a non-reduced version of the equation that works for me, so I always feel they omit explaining properly how they get from the non simplified equation, to the one in the matrix.
For starters, I have watched Chili's 3D fundamentals video on the subject, and have also read many good book's take on it.
It is the pre-perspective divide parts that are giving me trouble, so this question is gonna be the same for both perspective and orthographic projections.
Ok, I'm basically gonna step through the math here for just the x coordinate. Please tell me where I get things wrong.
Let's arbitrarily decide that in viewspace , the left edge is 30, and the right edge is 60. I purposely using fairly random numbers here, because it may help expose where I'm wrong on matters.
Let's say the FOV is 100°.
In the matrix Chili, and all my books show, x is multiplied by:
2n/right-left.
Using 1/tan(FOV/2), I get an n of .84
2*.84 is 1.68
1.68/(60-30) is .056.
Thus, the value in [0][0] of the matrix will be .056
Let's say my coordinate to be transformed is at x=45 in viewspace.
It should map to 0 in NDC space.
.056*45 is 2.52. Clearly I'm missing something.
What's weird to me, is that in my books, they usually start out with a non-reduced version of the equation that works for me, so I always feel they omit explaining properly how they get from the non simplified equation, to the one in the matrix.