CSE 160 -- Lab 2

Early if time stamp is before midnight Oct 19, 2019.
On time if time stamp is before midnight Oct 20, 2019.
Late submissions will not be accepted/graded.

Objectives:

Create a 3D surface model of a tapered cylinder and render it with diffuse lighting and flat shading. Also allow user to switch between flat shading and wireframe.

Description:

We make a short digression from our tree to make a tapered cylinder. Later on, we will be using the tapered cylinder to replace each of the line segment of the fractal tree. So, again using good data structure and instancing will be useful.

Upon starting your program, it should create and render a red tapered cylinder. For uniformity, this cylinder should have a circular base with radius = 1 on the x-y plane (ie. z=0 plane). Its length set to 10. And the top circle should have a radius = 0.5 on the z=10 plane. The base and top circles are actually dodecagon (12 sided polygon). The tapered cylinder is not capped.

Surface color is specified by the material property information. Use the following material property for a red surface exhibiting diffuse Lambertian reflectivity.

Ka  0 0 0
Kd  1 0 0
Ks  0 0 0
Also assume that the light source is pure white (1, 1, 1) and is coming from the direction [1, 1, 1]. The viewer is either at (0,0,∞) or (0, -∞, 75) depending on the viewing toggle (from Prog 1). Render the tree using the material properties above and with flat shading lit by the single light source.

Details:

Resources:

Read the descriptions and stare at the animations several times until you understand what's going on.

Directional lighting tutorial

The followind examples from the Matsuda Lea book are relevant to this assignment:

Grading:

Submission:

See course overview for instructions on what to submit and what not to submit.

Put materials in a folder named lab2 and zip it up. Submission must be done using Canvas.


Last modified Friday, 18-Oct-2019 19:41:14 PDT.