
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
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An assignment for the introduction to computer graphics course, fall 2005 (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. Problems 1 and 2 are worth 10 points each, and answering the optional extra question is worth 2 points.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!
Due: Wednesday September 14th at 11:59pm
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). The background should be black (i.e., RGB = [0,0,0]). Output the result to a PPM file, convert the results to JPG, GIF, PNG, or BMP and display them on your web page. Note coordinates are specified relative to an origin in the lower-left corner of the image. (This program should not use OpenGL)
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.
Problem 3 (0 points): How long did this assignment take you? (E-mail answers to cwyman@cs.uiowa.edu) Answering is optional, but will help me gauge the class — which should help you in the long run.
Extra Credit (2 points): Combine Problems 1 and 2 into a single OpenGL program, with an GLUT keyboard callback to switch from OpenGL rendering to your scan conversion, making sure to label which approach is currently being displayed. When using your scan conversion routine, you should use glBegin( GL POINTS ); to draw individual pixels.