CS 455 - Programming Assignment 2

This assignment is about using OpenGL transformations as described in the textbook in Sections 4.7 - 4.10, and in class on Monday, February 23. This assignment has two parts. Each part is an OpenGL program that uses a simple model and a number of transformations of that model to construct a complex scene.

Download this zip file. In the zip file you will find a skeleton OpenGL program called problem1.c and several image files that show sample results of the completed program. Your program should read an integer n off of the command line and then draw n equilateral triangles placed around the circumference of the unit circle. In the file problem1.c a model for an equilateral triangle is already defined. Your program should use OpenGL rotation, scaling, and translation transformations to place n instances of the model around the circumference of the circle. Here is what the result should look like when n = 8.

problem 1 with n=8

For the second problem, write an OpenGL program called problem2.c that draws the following hexagonal tiling. Your program should define a model that is a single hexagon inscribed in the unit circle. Your program should use OpenGL translation transformations to place the model in the scene so as to create the tiling. This image is an orthogonal projection of the (x,y)-plane with x between -10 and 10 and with y between -10 and 10.

problem 2

Turn in a zip file called CS455Hw2Surname.zip containing your two C programs. This assignment is due Wednesday, March 4.


Return to the main homework page.
Return to the CS 455 home page.


compliments and criticisms