Test Vol 1 Jun. 2014 | Page 11

1. Defining the space – Defining the 3D space Picture 6: A frustum in the clip space looking down the x axis Now we can complete step 2 by simply checking which points have their z between znear and zfar. Also we are able to check whether the point is behind the camera by checking if the point’s z is lower than znear. What about step 3? Firstly we need to specify the bounds of the projection plane. In math, planes have infinite size, but in our case our 2D spaces are bounded and therefore we need a bounded projection plane. In clip space, bounding our plane is easy: since camera is looking down the z axis and our projection plane is a rectangle, the bounds can be specified by two points (x, y, znear), where x and y are some numbers. We need two points to define the top-left and bottom-right corners. We simplified steps 2 and 3. But we can do more! Let us make projection plane’s bounds to be the same as that of the projection space. That is (-0.5 * a, 0.5, znear) for top-left and (0.5 * a, -0.5, znear) for bottom-right corner. The advantage is that once we project a point onto the projection plane we will already have the point in the projection space. That way we merged steps 3 and 4 together. From Picture 7 you can see how frustum is defined in clip space using our simplifications. Picture 7: Frustum’s definition in clip space 9