CS 45500 - Programming Assignment 1

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 (see Section 2.6 of our textbook). This assignment is due Wednesday, January 23.

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 each 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 CS455Hw1Surname.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.

This assignment is due Wednesday, January 23.


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


compliments and criticisms