Camera and Clipping Plane
CS-116A: Introduction to Computer Graphics
Instructor: Rob Bruce
Fall 2016

SLIDE 1: Camera and clipping plane

Illustration of near and far clipping planes

SLIDE 2: Camera and clipping plane

Illustration of near and far clipping planes with a stacked set of cylinders as objects between the near and far clipping planes. The cylinders are the viewable object.

SLIDE 3: View from camera

A group of cylinders (a viewable object) stacked together to demonstrate stacking order. This is the perspective of the cylinders from the camera between near and far clipping planes.

SLIDE 4: Stacking order of objects wrong!

A group of cylinders in the wrong stacking order from the view of the camera. A giant black "X" mark appears across the entire image to denote this is the wrong stacking order.

SLIDE 5: Near and far clipping planes

  • Distance between near and far clipping planes: z-buffering
  • Z-buffering:
  • - Defines how objects stack on each other when projected onto a flat screen.
  • - Objects close to near clipping plane will obstruct the view of objects in far clipping plane.

SLIDE 6: Interactive frustum program

Interactive program to adjust near and far clipping planes:

http://www.songho.ca/opengl/files/matrixModelView.zip

Note: This program will only run under Microsoft’s Windows operating system. It uses a combination of OpenGL as well as Windows API. However, you can still read the code.

The "take away" from reading the code: Linear transformations are used to adjust camera view when near or far clipping planes are adjusted. This is how we compute the view from the camera!

SLIDE 7: Interactive frustum program: screenshot

Screenshot of an interactive program to adjust the near and far clipping planes.

SLIDE 8: Interactive frustum program: screenshot

The arrow is pointing to the camera's perspective in the screenshot image below.

Screenshot of interactive program to adjust near and far clipping planes. An arrow is pointing to the camera's perspective within the screenshot.

SLIDE 9: Interactive frustum program: screenshot

The arrow is pointing to the far clipping plane in the screenshot image below.

Screenshot of interactive program to adjust near and far clipping planes. An arrow is pointing to the far clipping plane within the screenshot.

SLIDE 10: Interactive frustum program: screenshot

The arrow is pointing to the near clipping plane in the screenshot image below.

Screenshot of interactive program to adjust near and far clipping planes. An arrow is pointing to the near clipping plane within the screenshot.

SLIDE 11: Interactive frustum program: screenshot

The arrow is pointing to the near camera in the screenshot image below.

Screenshot of interactive program to adjust near and far clipping planes. An arrow is pointing to the camera within the screenshot.

SLIDE 12: Interactive frustum program: screenshot

The arrow is pointing to a control panel to adjust the camera's position (X,Y,Z) in the screenshot image below.

Screenshot of interactive program to adjust near and far clipping planes. An arrow is pointing to a control panel to adjust the camera's position (X,Y,Z).

SLIDE 13: Interactive frustum program: screenshot

The arrow is pointing to a control panel to adjust the camera's rotation (yaw, pitch, roll) in the screenshot image below.

Screenshot of interactive program to adjust near and far clipping planes. An arrow is pointing to a control panel to adjust the camera's rotation (yaw, pitch, roll).

SLIDE 14: Interactive frustum program: screenshot

The arrow is pointing to a control panel to adjust the teapot's position (X,Y,Z) in the screenshot image below.

Screenshot of interactive program to adjust near and far clipping planes. An arrow is pointing to a control panel to adjust the teapot's (object of interest) position in (X,Y,Z).

SLIDE 15: Interactive frustum program: screenshot

The arrow is pointing to a control panel to adjust the teapot's rotation (yaw, pitch, roll) in the screenshot image below.

Screenshot of interactive program to adjust near and far clipping planes. An arrow is pointing to a control panel to adjust the teapot's (object of interest) rotation (yaw, pitch, roll).

SLIDE 16: Interactive frustum program: screenshot

The arrow is pointing to the actual OpenGL commands (i.e. what you would use in an OpenGL program) to adjust the camera's position (X,Y,Z) and rotation (yaw, pitch, roll) in the screenshot image below.

Screenshot of interactive program to adjust near and far clipping planes. An arrow is pointing to the OpenGL commands (i.e. what you would use in an OpenGL program) to adjust the camera's position (X,Y,Z) and rotation (yaw, pitch, roll).

SLIDE 17: Interactive frustum program: screenshot

The arrow is pointing to the actual OpenGL commands (i.e. what you would use in an OpenGL program) to adjust the teapot's position (X,Y,Z) and rotation (yaw, pitch, roll) in the screenshot image below.

Screenshot of interactive program to adjust near and far clipping planes. An arrow is pointing to the OpenGL commands (i.e. what you would use in an OpenGL program) to adjust the teapot's (object of interest) position (X,Y,Z) and rotation (yaw, pitch, roll).

SLIDE 18: Interactive frustum program: screenshot

The arrow is pointing to the Model matrix's values that OpenGL uses to create the perspective view you see on the screen.

Screenshot of interactive program to adjust near and far clipping planes. An arrow is pointing to values in the OpenGL Model matrix.

SLIDE 19: For further reading

Computer Graphics with OpenGL (4th Edition) by Donald Hearn, M. Pauline Baker, and Warren R. Carithers (pp. 307- 357).