Docsity

Test 1 with Solution - Computer Graphics | CS 3451, Exams of Computer Graphics

Toggle sidebar
bg1
cs3451 Test 1 - Spring 2007
Solutions
1. Let O= (0,0,0). The triangle ∆ABC is visible from Oif Oand Dare on different sides of the plane
passing through A,Band C. Equivalently, it is visible if and only if ( ~
AB ×~
AC)·~
AO and ( ~
AB ×~
AC)·~
AD
are not of the same sign. Now, we have ~
AO = [−1,−2,−3], ~
AD = [0,−1,0] and
~
AB ×~
AC = [1,−1,0],
and therefore
(~
AB ×~
AC)·~
AO = 1
and
(~
AB ×~
AC)·~
AD = 1.
Thus, the triangle ABC is not visible.
By the same method:
(a) The triangle ABD is visible
(b) The triangle ACD is visible
(c) The triangle BCD is invisible
2. We apply the usual method, here attempting to represent the symmetry as a composition of known
elementary transformations. Thus, we:
(i) Translate by [−1,−2] (this takes the line into one passing through the origin)
(ii) Rotate by α=tan−1(0.5) clockwise – the line forms this angle with the x-axis so the rotation would
take it into the x-axis
(iii) Apply symmetry about the x-axis
(iv) Undo the rotation in (ii): rotate by αcounterclockwise
(v) Undo the translation (i) – trandslate by [1,2]
Now, it’s not hard to see that sin(α) = 1/√5 and cos(α) = 2/√5 (look at the triangle with vertices (1,2),
(3,3) and (3,2)). Thus, one of the forms of the answer is:
101
012
001
2/√5−1/√5 0
1/√5 2/√5 0
0 0 1
1 0 0
0−1 0
0 0 1
2/√5 1/√5 0
−1/√5 2/√5 0
0 0 1
1 0 −1
0 1 −2
0 0 1
3. When the viewpoint enters a tetrahedron, that tetrahedron will disappear (all faces of tetrahedra
containing the viewpoint will turn back-facing).
In general, the tetrahedra containing the viewpoint will not show up. The image would be equivalent to
the image of the tetrahedra that do not contain the viewpoint.
4. It’s not hard to see that the point symmetric to (x, y) about (a, b) is given by (2a−x, 2b−y). For
example, you may argue that to get a sequence of transformations equivalent to symmetry about (a, b) you
1
pf2

Partial preview of the text

Download Test 1 with Solution - Computer Graphics | CS 3451 and more Exams Computer Graphics in PDF only on Docsity!

cs3451 Test 1 - Spring 2007

Solutions

  1. Let O = (0, 0 , 0). The triangle ∆ABC is visible from O if O and D are on different sides of the plane passing through A, B and C. Equivalently, it is visible if and only if ( AB~ × AC~ ) · AO~ and ( AB~ × AC~ ) · AD~ are not of the same sign. Now, we have AO~ = [− 1 , − 2 , −3], AD~ = [0, − 1 , 0] and

AB^ ~ × AC~ = [1, − 1 , 0],

and therefore ( AB~ × AC~) · AO~ = 1

and ( AB~ × AC~ ) · AD~ = 1.

Thus, the triangle ABC is not visible.

By the same method:

(a) The triangle ABD is visible

(b) The triangle ACD is visible

(c) The triangle BCD is invisible

  1. We apply the usual method, here attempting to represent the symmetry as a composition of known elementary transformations. Thus, we:

(i) Translate by [− 1 , −2] (this takes the line into one passing through the origin)

(ii) Rotate by α = tan−^1 (0.5) clockwise – the line forms this angle with the x-axis so the rotation would take it into the x-axis

(iii) Apply symmetry about the x-axis

(iv) Undo the rotation in (ii): rotate by α counterclockwise

(v) Undo the translation (i) – trandslate by [1, 2]

Now, it’s not hard to see that sin(α) = 1/

5 and cos(α) = 2/

5 (look at the triangle with vertices (1, 2), (3, 3) and (3, 2)). Thus, one of the forms of the answer is:

 

  1. When the viewpoint enters a tetrahedron, that tetrahedron will disappear (all faces of tetrahedra containing the viewpoint will turn back-facing).

In general, the tetrahedra containing the viewpoint will not show up. The image would be equivalent to the image of the tetrahedra that do not contain the viewpoint.

  1. It’s not hard to see that the point symmetric to (x, y) about (a, b) is given by (2a − x, 2 b − y). For example, you may argue that to get a sequence of transformations equivalent to symmetry about (a, b) you

could translate by (−a, −b) (sending (x, y) into (x − a, y − b)), then apply symmetry about (0, 0) (sending (x − a, y − b) into (a − x, b − y)) and then translate by (a, b) (sending (a − x, b − y) into (2a − x, 2 b − y)).

Now, take any point (x, y) and apply A. The result is (2ax − x, 2 ay − y). Apply B and you get (2bx −

(2ax − x), 2 by − (2ay − y)) = (x + 2bx − 2 ax, y + 2by − 2 ax). This is (x, y) translated by the vector 2 ab~. Thus, the composite transformation is the translation by 2 ab~.

  1. The vector ab~ = [bx − ax, by − ay ] is obviously parallel to the line. An example of a vector perpendicular to the line is ~v = [ay − by , bx − ax] (check the dot product!). Now, the points p and q are on the same side of the line if and only if the angle between ~v and ap~ and the angle between ~v and aq~ are both less than 90 degrees or are both greater than 90 degrees. In algebraic terms, if ~v · ap~ and ~v · aq~ are of the same sign, or, equivalently, if (~v · ap~) ∗ (~v · aq~) ≥ 0. Thus the answer could be the following statement:

((ay − by )(px − ax) + (bx − ax)(py − ay )) ∗ ((ay − by )(qx − ax) + (bx − ax)(qy − ay )) ≥ 0

(a) For a perfectly diffuse surface, the brightest point is where the unit normal vector is the same as the light vector, i.e. for the point right below the light source (if you think of the z-axis as pointing up). Thus, the answer is: (lx, ly , 0).

(b) The brightest point is where the value of the Phong term is largest, i.e. where the normalized half-way vector is the same as the normal vector. Here is a picture showing the cross-section of the space along the plane that is parallel to the z-axis and contains l and v. l′^ and v′^ are the projections of l and v onto the plane and b is the point we are looking for.

α α

l

v

l’ b v’

N=H

Notice that the triangles ∆vv′b and ∆ll′b are similar and therefore the ratios |ll′| : |vv′| = lz : vz and |bl′| : |bv′| are the same. This means that the point b splits the interval l′v′^ into parts whose lenght ratio lz : vz. Thus, b can be computed as the weighted average of v′^ and l′^ with weights whose ratio is lz : vz , i.e. b =

lz lz + vz

v′^ +

vz lz + vz

l′^ =

lz vx + vz lx lz + vz

lz vy + vz ly lz + vz

  1. The intensty at the center of mass is the same for flat and Gouraud shaded image. This is because the illumination formula gives the same results when evaluated at the vertices of the triangle (because the angle between the normal and the light vector is the same for every vertex). For the Phong shaded image the intensity is higher. This is because the normalized interpolated normal vector (i.e. the normal to the triangle’s plane) overlaps with the normalized light vector at the center of mass (assuming the true normal for the triangle is used as the normal vector for all vertices) and the two vectors are not the same at the vertices.