I need to take some math classes I think. In the meantime… I have a ‘how do I…’ question.
I have a player position (P), and a player direction vector (D).
I want to make 4 planes, that are view frustum planes (excluding near and far planes). Left (L), Right (R), Top (T), and Bottom (B).
Now, all I have to do, is set the normal of the clipping planes to (D). Then, I rotate the plane how I want it. My problem is, the player is not at coordinate 0, 0, 0. So, I have to set the ‘D’ (distance from origin) attribute of the planes. But, how do I figure this?
y
|
P |
| |
|
|
x----------|-----------
|
|
|
|
|
So in the crappy diagram above, the player is P and the line from P points in the direction he is facing. How do I get planes set up so it’s like an upside down ‘V’ with the planes meeting at the player’s position?