

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
Material Type: Assignment; Professor: Jamin; Class: Interac Comp Graph; Subject: Electrical Engineering And Computer Science; University: University of Michigan - Ann Arbor; Term: Fall 2008;
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


EECS 487 Fall 2008 Homework - 3
Due 03 Nov 2008
1 Op enGL Lighting Mo del (25 pts)
You are an intelligen e agent who has to ommuni ate a se ret o de to another agent on the eld. You de ide to do this in an abstra t art museum by s ribbling a o de on a painting and making it sele tively visible to the eld-agent^1. The painting you ho ose is a 3-ft-by-6-ft square painted uniformly( with only one olor and the ink onforms to an Op enGL material with diuse olor 1 2 ,^
1 4 ,^
1 4
) and is titled CitiZen 2. It is lit with a dire tional light of Op enGL olor (1, 1 , 1) at an angle 300 from the verti al, from the eiling. During exhibit hours, the museum runs a white fog in the ro om (for surrealism) su h that a p erson at a distan e d feet from the enter of the painting sees only a fra tion (^) 1+^1 2 d^
of the olor from the painting and the rest, white from the ambient fog. To
take advantage of the white fog you de ide that the o de should app ear in white to the eld-agent so that others not a tively lo oking for it may dismiss it as an illusion from the fog should they see it by a ident. You sneak up the previous night and s ribble the o de on the painting at a height of 2.5 ft knowing that the eld-agent is 5-ft. tall. You write the o de with magi ink whi h onforms to an Op enGL material with diuse olor
( (^1) 2 ,^
1 4 ,^
1 4
) and sp e ular olor
( (^3) 4 ,^
7 8 ,^
3 4
)
. You have a full-feature ashlight from Op enGL Spy-Supplies In. whi h b ehaves like a sp ot-light with a narrow one. Your aim is to shine your ashlight on the painting when the eld-agent is in the riti al p osition so that he sees the o de from his p osition but others ontinue to see the painting. All lighting parameters available for any Op enGL light are ontrollable on the ashlight. The attenuation of the light from the ashlight due to fog and distan e has a onstant o e ient of 1, a linear o e ient of 1438 ft −^1 and a quadrati o e ient of 0. To make out the o de on the painting from the ba kground there must b e a minimum dieren e of 101 in ea h of the R,G,B omp onents of the olors rea hing the agent's eye from b oth materials.
Perform all al ulations using rational numb ers. All olors omp onents are in the range [0, 1].
(^1) Do not try this at home! (^2) The author's blurb by its side says that it is a full-length mirror and that a zen monk would b e able to see his silhouette in it in the same olor as the ba kground
2 Splines (20 pts)
2.1 Quarti spline (10 pts)
Determine the expression for the basis and onstraint matri es a quarti spline urve that of the form,
f (u) =
∑^4
i=
aiui, (1)
that interp olates/approximates 5 ontrol p oints p 0 , p 1 , p 2 , p 3 and p 4 a ording to the following sp e i ations:
= B
a 4 a 2 a 0 a 1 a 3
Show the development of all expressions leading upto Eqn. (2).
2.2 Spline inter onversion (8 pts)
Op enGL supp orts interp olation and approximation through evaluators. An evaluator is an engine whi h is initialized with 4 ontrol p oints and it returns p oints on the Bezier urve formed by these four p oints. Be ause all ubi splines an b e inter onverted, evaluators supp ort only Bezier urves and leave the task of expressing ustom ubi splines in terms of a related Bezier urve to the programmer. Given the requirement of generating a Catmull-Rom spline with ontrol p oints p 0 , p 1 , p 2 , and p 3 , how would you go ab out instru ting Op enGL to implement this using an evaluator?
2.3 Lagrange p olynomial interp olation (2 pts)
The Lagrange-p olynomial metho d of interp olation is way of interp olating an arbitrary set of p oints. What are its advantages and disadvantages?
3 Texture Cub e-Mapping (15 pts)
On page 254 of the textb o ok, the expression is derived for the ub e map mapping from (x, y, z) dire tion ve tor to (u, v) o ordinates of one of the ub e fa es for whi h the ondition is x > |y| , x > |z|. Derive similar expressions for the other ve fa es of the ub e. For the fa es that are parallel to the z-axis assume that the v o ordinate go es in the dire tion of the z-axis, and u- o ordinate is oriented so that the o ordinate system (u, v, n)(where n is the outward normal dire tion) is right-handed. For the top and b ottom fa es orthogonal to z-axis, orient u and v in the same way as x and y are oriented. Note that on ea h fa e u and v should vary from 0 to 1. In your answer, write down the ondition for ea h fa e followed by the expression onverting (x, y, z) to u and v.