Docsity

5 Practice Problems on Computer Graphics - Assignment 10 | 22C 151, Assignments of Computer Graphics

Toggle sidebar
bg1
Fall 2004
22C:151 Introduction to Computer Graphics
Assignment 10
Due: Tuesday November 30th at 12:01am (Monday at midnight)
Goal: Extend your basic raytracer to handle shadows, reflections, refractions, and triangles.
Problem 1 (5 points): Extend your ray tracer so that it computes a shadow on diffuse surfaces. In other words when
your ray hits a diffuse surface, before shading you should check if the light is visible from the hitpoint. If the light is
visible, you should shade as normal. If the point is shadowed, then you can either return black or some ambient term.
Problem 2 (5 points): Add a reflective material that behaves like a perfect mirror.
Problem 3 (10 points): Add a refractive material that transmits light.
Problem 4 (5 points): Add a triangle object type to your ray tracer.
Problem 5 (5 points): Read in an OBJ file to your raytracer and render it using a diffuse material type. Remember
OBJ files consist of a number of triangles, a primitive you added to your ray tracer in problem 4.
Hint: Look at the ’glm.c’ file (and glmDraw() in particular) in order to figure out how the triangle data is
loaded into memory.
Hint: If you use large models, your ray tracer will run very, very, very slowly. Use a smaller model, like Al
Capone.
Extra Credit (5 points): Modify your ray tracer into a path tracer. Your need only worry about diffuse surfaces and
you can assume the only lightsource is a (non-black) constant color background.
NOTE: A “README” file is required in order to get full credit! Please tell us how to compile and run your program.
When we run the program with no parameters, it should create a PPM file which demonstrates all 5 problems from the
homework! (This means, you’ll need to have an example scene with shadows, reflections, refractions, and a mesh!)
NOTE: A couple example images and data to recreate them will be posted online before Thanksgiving break.

Partial preview of the text

Download 5 Practice Problems on Computer Graphics - Assignment 10 | 22C 151 and more Assignments Computer Graphics in PDF only on Docsity!

Fall 2004

22C:151 Introduction to Computer Graphics

Assignment 10

Due: Tuesday November 30th at 12:01am (Monday at midnight)

Goal: Extend your basic raytracer to handle shadows, reflections, refractions, and triangles.

Problem 1 (5 points): Extend your ray tracer so that it computes a shadow on diffuse surfaces. In other words when your ray hits a diffuse surface, before shading you should check if the light is visible from the hitpoint. If the light is visible, you should shade as normal. If the point is shadowed, then you can either return black or some ambient term.

Problem 2 (5 points): Add a reflective material that behaves like a perfect mirror.

Problem 3 (10 points): Add a refractive material that transmits light.

Problem 4 (5 points): Add a triangle object type to your ray tracer.

Problem 5 (5 points): Read in an OBJ file to your raytracer and render it using a diffuse material type. Remember OBJ files consist of a number of triangles, a primitive you added to your ray tracer in problem 4.

Hint: Look at the ’glm.c’ file (and glmDraw() in particular) in order to figure out how the triangle data is loaded into memory.

Hint: If you use large models, your ray tracer will run very, very, very slowly. Use a smaller model, like Al Capone.

Extra Credit (5 points): Modify your ray tracer into a path tracer. Your need only worry about diffuse surfaces and you can assume the only lightsource is a (non-black) constant color background.

NOTE: A “README” file is required in order to get full credit! Please tell us how to compile and run your program. When we run the program with no parameters, it should create a PPM file which demonstrates all 5 problems from the homework! (This means, you’ll need to have an example scene with shadows, reflections, refractions, and a mesh!)

NOTE: A couple example images and data to recreate them will be posted online before Thanksgiving break.