Color, Projections, and Viewports

Tom Kelliher, CS 320

Feb. 23, 2009

Administrivia

Announcements

Project 1 due Wednesday.

Assignment

Read Chapter 3.1-3.3, 3.6.

From Last Time

2-D OpenGL lab.

Outline

  1. Color.

  2. Projections.

  3. Viewports.

  4. Lab.

Coming Up

Interactive techniques.

Color

Additive color. Tristimulus values vs. continuous frequency of light.

Two color models:

  1. RGB color.

    The color cube.

  2. Indexed color.
    1. What is it? Why use it?

    2. Where is it used?

      In 8-bit mode, which 256 colors get displayed? Color map clashes in X Window system.

Orthographic Projection

Now we see the mapping:

\begin{displaymath}
(x, y, z) \rightarrow (x, y, 0)
\end{displaymath}

glOrtho(GLdouble left, GLdouble right,
        GLdouble bottom, GLdouble top,
        GLdouble zNear, GLdouble zFar);

Viewports

What happens when the aspect ratio of the clipping region doesn't match that of the window?

How can we fix that:



Thomas P. Kelliher 2009-02-20
Tom Kelliher