Consider the side-view of a perspective camera shown below: the image looks at the plane from the direction. The scene point at appears in the viewport at . Based on this view, calculate the value of , the y coordinate of the viewing ray’s intersection with the viewport, in terms of the pixel’s 3D coordinates and the camera’s focal length . Hint: no trig necessary! Try similar triangles.
Which of the following 3D homogeneous 4-vectors represent the same point as the point ?
Let's modify the wire.jl
code from last time to support perspective rendering.
eye
to . Then we'll make a more sensible camera projection plane by putting the viewport in front of the eye: in the orthographic projection parameters, change n
from 2
(which is behind the camera) to -2 (in front of the camera).If your implementation matches mine, you'll see an output like the following: