CS 455 - Programming Assignment 2

This assignment is about OpenGL's graphics primitives. For this assignment you need to draw a few geometric shapes using triangle strips, triangle fans, and quad strips. This assignment is due Monday, February 7.

Download this zip file. In the zip file you will find five skeleton OpenGL programs called Exercise-n.c and six image files called Exercise-n.png . For n=1,2,3,4,5, you need to finish the associated C program so that it models the figure in the associated image file. For n=6, you need to answer a question about Exercise-6.png.

In Exercise-1.c, have the display() function draw a single triangle strip that would model this figure.

annulus
Your program should give each of the triangles in the triangle strip a counter-clockwise orientation. Then OpenGL will draw the triangles in a "wireframe" manner, and you can see your triangulation. You should do this using only the eight vertices that are the corners of the annulus. Do not add any new vertices to the figure.

In Exercise-2.c, have the display() function draw two triangle fans that would model the above figure (the square annulus). Your program should give each of the triangles in the triangle fans a counter-clockwise orientation. Then OpenGL will draw the triangles in a "wireframe" manner, and you can see your triangulation. You should do this using only the eight vertices that are the corners of the annulus. Do not add any new vertices to the figure.

In Exercise-3.c, have the display() function draw a single quad strip that would model this figure.

double-annulus
Your program should give each of the quads a counter-clockwise orientation. Then OpenGL will draw the quads in a "wireframe" manner. You should do this using only the 12 vertices that are the corners of the double annulus. Do not add any new vertices to the figure.

In Exercise-4.c, have the display() function draw a single quad strip that would model this figure.

U-shape
Your program should give all of the quads a counter-clockwise orientation. You should do this using only the 12 vertices that are the corners of the U-shape. Do not add any new vertices to the figure.

In Exercise-5.c, have the display() function draw a single triangle fan that would model this figure.

T-shape
Your program should give all of the triangles a counter-clockwise orientation. You will need to add one new vertex to the figure.

For Exercise-6, write a paragraph in a text file that explains why the three quads in the following picture cannot be a quad strip.

T-shape

Turn in a zip file called CS455Hw2Surname.zip (where Surname is your last name) containing your versions of Exercise-n.c, for n=1,2,3,4,5, and also a text file containing your explanation of why the figure Exercise-6.png cannot be a quad strip. If you would like to, you can also include screen shots of the results of your five programs.

This assignment is due Monday, February 7.


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


compliments and criticisms