Some things that might make things easier: camera is always facing that plane, and the plane is actually xz plane of world coordinate system.
I didn’t find any out of the box function for calculating this.
One idea I have is to take frustum lines and get line-plane intersection for each line, but Camera.get_frustum ( ) is not documented, it says only it returns Array, I can only guess that it is Array of vertices, but can’t be sure. And if it is vertices, in what order?
Thanks.
Igor
capital C which is the camera position is not to be confused with lowercase c which is a component of the plane’s normal vector.
Also in the final equation for t, notice the bottom of the division it should be c * Znear and not just Znear. You’d also probably want to write that last equation in dot product form.
Essentially, finding these 4 points of the trapezoid is a function of the plane equation, the camera position, the fov of the camera, the width and height of the window, and znear.
I solved the equation for only the top left point of the trapezoid. But you can generalize this to find all four, the only thing you’re changing is Dy and Dx. You must realize the cross section for these planes are going to yield trapezoids. The only situation in which we get a rectangle is when the normal of the plane is parallel to the vector (0, 0, 1), as illustrated in the example above.