
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An assignment for the introduction to computer graphics course, fall 2004 (22c:151). Students are required to write programs for scan converting triangles and rendering them using opengl and glut. The assignment includes drawing specific triangles with given vertices and colors, as well as rendering white lines. The goal is to output the results to ppm files for problem 1 and capture images for problem 2, which should be posted on a webpage.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

Due: Thursday September 16th at 12:01am (Wednesday at midnight)
Goal: Write a program that scan converts triangles and outputs them to a PPM file. Write a second program that draws the same triangles using OpenGL and GLUT.
Problem 1 (10 points): Write a program that draws the following triangles into a 512 × 512 buffer (in memory). Output the result to a PPM file. The background should be black (i.e., RGB = [0,0,0]). Use a utility program to convert the PPM file to GIF, PNG or BMP to display on your web page (use ppmtogif , ppmtobmp , or xv on Linux systems or GIMP on Windows systems).
Problem 2 (10 points): Write an OpenGL/GLUT program that draws the same triangles (and lines) as in Problem 1, using the same colors. Capture the result in an image and post it on your web page. Make sure to label your images, so I know which is from Problem 1 and which is from Problem 2.
NOTE: Feel free to combine these problems into a single program, with an GLUT keyboard callback to switch from OpenGL rendering to your scan conversion (as per the extra credit from Homework 2), making sure to label which approach is currently being displayed.
Problem 3 (0 points): How long did this assignment take you? (E-mail answers to [email protected]) Answering is optional, but will help me gauge the class — which should help you in the long run.