CS 418: Homework #2 - Splines, Transformations, and Shading, Assignments of Computer Graphics

Information about cs 418 homework #2, which includes questions related to defining a new spline type, transforming shapes using given transformations, and shading a plane using the phong illumination equation. Students are expected to derive the basis matrix for a new spline type, describe how to transform shapes using given transformations, explain why a highlight appears in a cylinder when using phong shading but not gouraud shading, and calculate the composition of rgb colors with alpha values.

Typology: Assignments

Pre 2010

Uploaded on 03/16/2009

koofers-user-6fj-1
koofers-user-6fj-1 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 418: Homework #2
Assigned: Wednesday October 5, 2005
Due: Tuesday October 11, 2005
These questions are intended to help you prepare for the midterm exam. A few of them are actual questions
from past exams. The rest are things that I could imagine asking on an exam.
Please be organized when writing your answers to these questions. Make sure that all solutions are
clearly indicated and labelled with the question they are answering. Remember to write clearly and legibly.
Unreadable answers will receive 0 credit.
1. We want to define a new spline type with control points p0,p3,r1,r2. The curve should interpolate its
endpoints p0,p3and should have tangents r1,r2at u=1
/
2and u=3
/
4, respectively. Given that our
standard matrix-form for this cubic splines will be
p(u) = 1u u2u3M
p0
p3
r1
r2
derive the 4×4 basis matrix Mfor this class of splines.
2. Suppose that you are given the following shape:
(−1, −1)
(1, 1)
For each of the following figures, describe how to transform the initial shape above into the given result.
You may only use combinations of the following three transformations:
T: translate by [1 1] S: scale by [2 1] R: rotate (counter-clockwise) by 45
NOTE: Your answers should consist of products of these 3 fundamental matrices. Make sure to put
them in the correct order.
pf3

Partial preview of the text

Download CS 418: Homework #2 - Splines, Transformations, and Shading and more Assignments Computer Graphics in PDF only on Docsity!

CS 418: Homework

Assigned: Wednesday October 5, 2005

Due: Tuesday October 11, 2005

These questions are intended to help you prepare for the midterm exam. A few of them are actual questions from past exams. The rest are things that I could imagine asking on an exam. Please be organized when writing your answers to these questions. Make sure that all solutions are clearly indicated and labelled with the question they are answering. Remember to write clearly and legibly. Unreadable answers will receive 0 credit.

  1. We want to define a new spline type with control points p 0 , p 3 , r 1 , r 2. The curve should interpolate its endpoints p 0 , p 3 and should have tangents r 1 , r 2 at u = 1 / 2 and u = 3 / 4 , respectively. Given that our standard matrix-form for this cubic splines will be

p(u) =

[

1 u u^2 u^3

]

M

p 0 p 3 r 1 r 2

derive the 4×4 basis matrix M for this class of splines.

  1. Suppose that you are given the following shape:

(−1, −1)

(1, 1)

For each of the following figures, describe how to transform the initial shape above into the given result. You may only use combinations of the following three transformations:

T : translate by [1 1] S : scale by [2 1] R : rotate (counter-clockwise) by 45◦

NOTE: Your answers should consist of products of these 3 fundamental matrices. Make sure to put them in the correct order.

(a) (b) (c) (d)

  1. Harvey has written some code to draw the following unit cylinder:

y

z

radius r = 1

height h = 1

x

His drawing code places vertices along the upper and lower rims of the cylinder, connecting them together with triangles which stretch the entire length of the cylinder. He draws the cylinder using a shiny material. Given the position of the light, he expects to see a specular highlight in the middle of the cylinder. (a) When Harvey executes his OpenGL code (using Gouraud shading) no highlight appears in the middle of the cylinder. However, when he renders it with RenderMan (using Phong shading) the highlight appears. Explain why this is. (b) How could the OpenGL code be altered (still using Gouraud shading) so that the highlight would appear?

  1. You are given three RGB colors with corresponding alpha values:

A = (0. 7 , 0. 5 , 0 .6) αA = 0. 5 B = (1, 1 , 0) αB = 0. 9 C = (0, 0 , 1) αC = 0. 7

(a) Calculate (A over B over C) using the composition rules defined in class. (b) Calculate (C over B over A) using the composition rules defined in class.

  1. Consider a plane described by the equation n·p + d = 0. Suppose that we wish to shade this plane using the Phong illumination equation discussed in class. Assume that the reflectance coefficients kd, ks, ka are given to you. Furthermore, assume that the single point light source in the scene is located at position x and emits light with intensity IL. The camera is located at position e. (a) Consider some point p on the plane. Compute the intensity of diffuse reflectance at this point p.

Page 2