



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
Solutions to various problems related to cubic splines and shape transformations. The first problem involves deriving the basis matrix for a new spline type with given control points and tangents. The second problem deals with transforming an initial shape into given figures using combinations of translate, scale, and rotate transformations. The third problem explains why a specular highlight appears when rendering a cylinder using phong shading instead of gouraud shading. The fourth problem involves calculating the composition of three polygons using given rgb colors and alpha values.
Typology: Assignments
1 / 5
This page cannot be seen from the preview
Don't miss anything!




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
p 0
p 3
r 1
r 2
derive the 4×4 basis matrix M for this class of splines.
Solution:
Suppose
p(u) = a 0 + a 1 u + a 2 u
2
1 u u
2 u
3
a 0
a 1
a 2
a 3
then
a 0
a 1
a 2
a 3
p 0
p 3
r 1
r 2
The four equations defining p can be written as:
p(0) = p 0 = a 0
p(1) = p 2 = a 0 + a 1 + a 2 + a 3
p
′ (
) = r 1 = a 1 + a 2 +
a 3
p
′ (
) = r 2 = a 1 +
a 2 +
a 3
Write these equations in matrix form, we get:
p 0
p 3
r 1
r 2
3 4 0 1
3 2
27 16
a 0
a 1
a 2
a 3
thus
a 0
a 1
a 2
a 3
3 4 0 1
3 2
27 16
p 0
p 3
r 1
r 2
Compare this with (*) we get:
3 4 0 1
3 2
27 16
− 1
NOTE: It is acceptable to leave answer as a matrix to be inverted as above.
9 2
9 2
3 2
15 2
15 2
11 2
(−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)
(a) Solution:
(b) Solution:
(c) Solution:
4 T
For both parts below it will be useful to derive a general formula for calculating the composition of 3
polygons.
Lets find a formula for (D over E over F ) and its corresponding alpha value.
αD D + (1 − αD )(E over F )
′
αD D + (1 − αD )(αE E + (1 − αE )αF F )
αD D + (1 − αD )αE E + (1 − αD )(1 − αE )αF F
Let the alpha value of (D over E over F ) be αDoEoF. αDoEoF will be used to de-premultiply the result
of the equation above.
αDoEoF = αD + (1 − αD )(αEoF )
αDoEoF = αD + (1 − αD )(αE + (1 − αE )αF )
αDoEoF = αD + (1 − αD )αE + (1 − αD )(1 − αE )αF
(a) Calculate (A over B over C) using the composition rules defined in class.
Solution:
(A over B over C)
′ = (0. 8 , 0. 7 , 0 .335)
De-premultiply:
αAoBoC =. 985
A over B over C = (0. 812 , 0. 711 , 0 .340)
(b) Calculate (C over B over A) using the composition rules defined in class.
Solution:
(C over B over A)
′ = (0. 281 , 0. 278 , 0 .709)
De-premultiply:
αCoBoA =. 985
C over B over A = (0. 285 , 0. 282 , 0 .720)
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.
Solution:
ID = ILkd max(n·
(x − p)
‖x − p‖
(b) The point on the plane for which the diffuse reflectance is maximal is the perpendicular projection
of x onto the plane. Explain why this is true.
Solution:
The diffuse reflectance is maximal when n·
(x−p) ‖x−p‖ is maximal. The dot product is maximized when
the angle beween two vectors is 0. In the context of this problem, this means that n ·
(x−p) ‖x−p‖ is
maximized when n and
(x−p) ‖x−p‖
are the same vector (i.e. when the light vector and normal vector
are the same, which is the perpendicular projection of x onto the plane).
(c) Derive an equation for the perpendicular projection of x onto the plane.
Solution:
Let p be a point on the plane.
Let w be the vector from p to x.
Let q be the perpendicular projection of x onto the plane.
w = x − p
q = x − (signed projection of w onto n)n
q = x − (w·n)n
q = x − ((x − p)·n)n