Projected Chopper

Previously we viewed the chopper with a perspective camera that had 80° field of view (angle from bottom to top of the view frustum). It is time to try out other values for it and also the orthographic projection.

Perspective projection assumes that the viewer is a point in space. The view pyramid has the peak at the viewer's position, the field of view defines the vertical angle near the peak. Aspect ratio (width / height) defines the horizontal angle. Then we have the near and far clipping planes that define the frustum (part of the pyramid).

If the field of view is small, then objects in the middle of the frustum will be projected bigger and there will be little depth perception. If the field of view is large, then objects near the edges of the frustum will be projected bigger and the scene might become distorted the other way.

Orthographic camera assumes that the viewer is located infinitely far. It is the same as if the viewer would be a plane. Objects will be orthogonally projected and there will be no depth perception. This is often used in engineering drawings where depth perception might distort the object too much.

In this task we will create a secondary camera that will render the scene with a orthographic projection. In order to see both the orthographic and perspective together, we will use a small secondary viewport inside our main canvas. Into the secondary viewport project the chopper orthographically from the front, side and top (main views used in engineering). You can switch between those views with some time interval or make it depend on the user input, if you want.

Secondly, change the field of view of the main camera depending on the user input. You can have the arrow key right increase it and the arrow key left decrease it. Observe the hangar and the chopper with different field of views. What happens if the field of view is too big or too small (less than 0° or more than 180°), why?

The result should be something like:

With the orthographic views alternating between those:

In order to render the secondary viewport, you need to enable the scissor test. That test will cut out only the area, where you actually rendered with your camera. Otherwise the whole output color buffer can be overwritten with values from the second rendering.

;