



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
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Exam; Professor: Merrell; Class: Introduction to Computer Graphics; Subject: COMPUTER SCIENCE; University: University of North Carolina - Chapel Hill; Term: Unknown 1989;
Typology: Exams
1 / 7
This page cannot be seen from the preview
Don't miss anything!
Name: General Advice Partial credit will be given, so even if you can not solve the problem get as close as you can to the solution and show your work. Since you have limited time, I would suggest getting all the easier questions out of the way first. Skip questions that look hard and come back to them later if you have time.
If and only if both endpoints of the line segment are to the left of the drawing area or both endpoints are to the right of the drawing area or both endpoints are above the drawing area or both endpoints are below the drawing area the line segment should be immediately rejected.
cos θ − sin θ 0 sin θ cos θ 0 0 0 1
s 0 0 0 s 0 0 0 1
s cos θ −s sin θ 0 s sin θ s cos θ 0 0 0 1
s 0 0 0 s 0 0 0 1
cos θ − sin θ 0 sin θ cos θ 0 0 0 1
s cos θ −s sin θ 0 s sin θ s cos θ 0 0 0 1
Yes, the matrices commute.
t
defines a line in parametric form. What is the 4 × 4 matrix that will rotate a point about the line by θ degrees? Assume the right hand rule when rotating about the positive y-axis. (7 points)
cos θ 0 sin θ 0 0 1 0 0 − sin θ 0 cos θ 0 0 0 0 1
b. Suppose the center of an object is located at the point (− 1 , 4 , 2 ). What is the 4 × 4 matrix that will scale down an object by 50% in towards the object’s center? (7 points)
c. Let p be any point in space. Let p′^ be the closest point to p on the plane defined by
ax + by + cz + d = 0 (14)
To make things simpler, you may assume that a^2 + b^2 + c^2 = 1, if you wish. What is the 4 × 4 matrix that will transform p to p′? (12 points)
p′^ = p + sn (15)
=
px py pz 1
+^ s
a b c 0
a(px + sa) + b(py + sb) + c(pz + sc) + d = 0 (17)
apx + sa^2 + bpy + sb^2 + cpz + sc^2 + d = 0 (18)
s(a^2 + b^2 + c^2 ) = −(apx + bpy + cpz + d) (19)
s = −(apx + bpy + cpz + d) (20)
p′^ = p − (apx + bpy + cpz + d)n (21)
= p −
a b c 0
[ (^) a b c d ]
px py pz 1
a^2 ab ac ad ab b^2 bc bd ac bc c^2 cd 0 0 0 1
p^ (23)
d. True or False The matrix given in response to the previous question is a projection matrix? ( points) True, the matrix projects the point onto a plane, P^2 = P.
c. Suppose that the E pixel (xp + 1 , yp) is drawn. How do we efficiently decide which is the next pixel to draw? Like the midpoint line algorithm, you should use information obtained in the first decision to help in making this next decision. You should update some kind of decision variable d. You should not recompute f (x, y) in its entirety. (7 points)
dold = (xp + 1 )^2 + (yp + 12 )^2 − R^2 (25) = x^2 p + 2 xp + 1 + y^2 p − yp + 14 − R^2 (26)
The new midpoint is one greater in x.
dnew = (xp + 1 )^2 + 2 (xp + 1 ) + 1 + y^2 p − yp + 14 − R^2 (27) = x^2 p + 2 xp + 1 + 2 xp + 2 + 1 + y^2 p − yp + 14 − R^2 (28)
dnew − dold = 2 xp + 3 (29) Update the decision variable by 2 xp + 3 and check if it is greater or less than 0. d. Same question as part c, but now assume the SE pixel (xp + 1 , yp − 1 ) was drawn initially. How do we efficiently decide which is the next pixel to draw? (7 points)
The new midpoint is now one greater in x and one less in y.
dnew = (xp + 1 )^2 + 2 (xp + 1 ) + 1 + (yp − 1 )^2 − (yp − 1 ) + 14 − R^2 (30) = x^2 p + 2 xp + 1 + 2 xp + 2 + 1 + y^2 p − 2 yp + 1 − yp + +^14 − R^2 (31)
dnew − dold = 2 (xp − yp) + 5 (32) Update the decision variable by 2 (xp − yp) + 5 and check if it is greater or less than 0.