

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


(i) We need to determine intersection points of the ray starting at (0, 0) and passing through (0, 1) and the intervals A and B and figure out which is closer to (0, 0). Now, intersections of that ray and the intervals are the same as intersections of the intervals and the y-axis. For interval B, the intersection is at (0, 3) (in fact, it’s a horizontal inter- val). For interval A, the y-coordinate of the intersection is 2 − 2 ∗(slope of A), i.e. 2 − 2(− 10298 ) = 400102 > 3. Thus, the intersection of the ray and interval B is closer to the origin and therefore we see B at pixel (0, 1).
(ii) The pipeline approach is able to correctly resolve visibility, therefore the answer is: B.
(iii) The screen coordinates of endpoints of A are ( 22 , 2) = (1, 2) and ( − 100100 , 100) = (− 1 , 100). The screen coordinates of endpoints of B are ( 13 , 3) and (− 13 , 3). We need the interpolated depth for fragments generated for both intervals at x = 0, which is the point exactly in the middle of both projected intervals. Thus, for A the depth is 2+100 2 = 51 and for B the depth is 3+ 2 = 3. The interval that shows up at pixel at 0 is still^ B NOTE: I meant to show that one can get a wrong answer in (iii) but somehow it didn’t work. I guess I am not good enough with numbers. Try to figure out the answer if the endpoints of B are replaced with (1, 4) and (1, −4), perhaps I’ll put this variant on the final :). Be able to relate it to the depth interpolation in graphics pipeline.
Another way to look at it (cf our treatment of triangle’s normal in class) would be to make sure that the normal vector points to the side of the tangent plane at p that contains the viewpoint. This leads to the following pseudocode: if pc~ · pv~ ≥ 0 then return − cpR~ else return cpR~ Of course, there are several equivalent ways to write any of the above.
Now, (b) gives equations
a 11 + 2a 12 + 3 = 7 a 21 + 2a 22 + 4 = 9
and (c)
−a 11 + a 12 + 3 = 3 −a 21 + a 22 + 4 = 5
All of the above are obtained by multiplying the unknown (except for last col- umn) matrix by vectors representing points (1, 2) and (− 1 , 1) in homogenous coordinates. These are four equations with four unknowns. In fact, we have two pairs of equations with two unknowns each. a 11 and a 12 can be computed from the first and third equation: a 11 = 4/3 and a 12 = 4/3. Similarly, a 21 and a 22 can be computed from the second and fourth equation. a 22 = 2 and a 21 = 1. Answer: (^)
or (x 2 − x 1 )(y 3 − y 1 ) − (y 2 − y 1 )(x 3 − x 1 ). The algebraic condition would be true if vertices come in counterclockwise order is
(x 2 − x 1 )(y 3 − y 1 ) − (y 2 − y 1 )(x 3 − x 1 ) ≥ 0