LMU ☀️ CMSI 3710
COMPUTER GRAPHICS
HOMEWORK #1 Due: 2011-01-27

Read the first two chapters in Angel's book and the first two chapters in the Red Book.

Do all of the following problems using your Subversion repository that comes with your lab account. Consider placing them in your repository as follows:

    /
        homework
            cmsi371
                src
                    main
                        cpp
                            colorwheel.cpp
                            psychedelicsquare.cpp
                    doc
                        homework1.tex

Turn in a hardcopy of your solutions — generated as a PDF from your LaTeX source with all source code attached. Make sure that you do not save any tab characters in your source code, and that there is no line wrapping in your printed submission.

  1. Make a circle program, similar to the triangle program as follows. Make a circle by passing GL_TRIANGLE_FAN to glBegin, and generating a few hundred points on a circle of radius 1. The color of each outer vertex should vary smoothly from pure red to yellow to green to cyan to blue to magenta and back to red. The center should be white.
  2. Write an OpenGL application that renders a square of width 10 units on the xz plane, centered at the origin. Subdivide the square into 100 equal parts, with each of the 121 vertices having a random color. View the square with a perspective projection formed with an interesting combination of gluPerspective and gluLookAt, as in the torus example.
  3. Problem 2.22 in Angel's book.