Interactive Computer Graphics - Homework 3 - Fall 2008 | EECS 487, Assignments of Electrical and Electronics Engineering

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

Pre 2010

Uploaded on 09/02/2009

koofers-user-t58
koofers-user-t58 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
EECS 487 Fall 2008 Homework - 3
Due 03 Nov 2008
1 OpenGL Lighting Model (25 pts)
You are an intelligene agent who has to ommuniate a seret ode to another agent on the eld.
You deide to do this in an abstrat art museum by sribbling a ode on a painting and making
it seletively visible to the eld-agent
1
. The painting you hoose is a 3-ft-by-6-ft square painted
uniformly with only one olor and the ink onforms to an OpenGL material with diuse olor
1
2,1
4,1
4
and is titled
CitiZen
2
. It is lit with a diretional light of OpenGL 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
room (for surrealism) suh that a person at a distane
d
feet from the enter of the painting sees
only a fration
1
1+ 1
2d
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 ode should appear in white to the eld-agent so
that others not atively looking 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 ode on the painting at a height of 2.5 ft
knowing that the eld-agent is 5-ft. tall. You write the ode with magi ink whih onforms to an
OpenGL material with diuse olor
1
2,1
4,1
4
and speular olor
3
4,7
8,3
4
. You have a full-feature
ashlight from OpenGL Spy-Supplies In. whih behaves like a spot-light with a narrow one. Your
aim is to shine your ashlight on the painting when the eld-agent is in the ritial position so that
he sees the ode from his position but others ontinue to see the painting. All lighting parameters
available for any OpenGL light are ontrollable on the ashlight. The attenuation of the light from
the ashlight due to fog and distane has a onstant oeient of 1, a linear oeient of
8
143
ft
1
and a quadrati oeient of 0. To make out the ode on the painting from the bakground there
must be a minimum dierene of
1
10
in eah of the R,G,B omponents of the olors reahing the
agent's eye from b oth materials.
1. What is the expression for the total olor observed by the eld-agent at a distane
d
from a
point of atual olor
(rp, gp, bp)
(after lighting alulations et) ? (3 pts)
2. What general settings would you hoose for your ashlight? (2 pts)
3. What is the maximum distane from the painting that the ode will be visible at all? (10 pts)
4. Supp ose the agent has parked himself at a total distane of 6 ft. from the painting and is 3
ft. to the left of the enter, where should you position yourself so that you an shine your
ashlight? What exat settings would you make on your ashlight? (10 pts)
Perform all alulations using rational numbers. All olors omponents 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 be able to see his
silhouette in it in the same olor as the bakground
1
pf2

Partial preview of the text

Download Interactive Computer Graphics - Homework 3 - Fall 2008 | EECS 487 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

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.

  1. What is the expression for the total olor observed by the eld-agent at a distan e d from a p oint of a tual olor (rp, gp, bp) (after lighting al ulations et )? (3 pts)
  2. What general settings would you ho ose for your ashlight? (2 pts)
  3. What is the maximum distan e from the painting that the o de will b e visible at all? (10 pts)
  4. Supp ose the agent has parked himself at a total distan e of 6 ft. from the painting and is 3 ft. to the left of the enter, where should you p osition yourself so that you an shine your ashlight? What exa t settings would you make on your ashlight? (10 pts)

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:

  1. The urve must interp olate p 0 , p 2 and p 4 ,
  2. The slop e at p 0 must b e twi e the displa ement from p 0 to p 1 ,
  3. The slop e at p 4 must b e thri e the displa ement from p 3 to p 4.
  4. The basis matrix B should b e of the form,       p 2 p 0 p 3 p 1 p 4

     

= 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.