Multiple Views

Multiple projections can also be used for multiple views of a scene.

In this case, the different views typically occupy different areas of the screen.

This is accomplished using viewports.
In OpenGL, the "scissor test" must also be used.

        glViewport(x, y, width, height);
        glScissor(x, y, width, height);
        glEnable(GL_SCISSOR_TEST);

defines the region of the window that is to be used for rendering. By default, the full window is used.

Without the scissor test, certain operations, such as glClear, will overflow beyond the defined viewport and affect the entire window.

Example: rearview.cpp



next