Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Computer Graphics question! Need an answer asap!! Thank you! Consider a line in

ID: 3691195 • Letter: C

Question

Computer Graphics question! Need an answer asap!! Thank you! Consider a line in 3D going from the world-coordinate points P_1, (6. 10, 3) to P_2 (-3,-5,2) and a semi-infinite viewing pyramid in the region -Z lessthanorequalto x lessthanorequalto z, -z lessthanorequalto y lessthanorequalto z, which is hounded by the planes z=+x, z= -x, z=+y, z=-y. The projection plane is at z = 1. a.Clip the line in 3D (using parametric line equations), then project it onto the projection plane. What are the clipped endpoints on the plane? b.Project the line onto the plane, then clip the lines using 2D computations. What arc the clipped endpoints on the plane?

Explanation / Answer

Hi below i have given the solution for your reference,

(a) Clip the line in 3D (using parametric line equations), then project it onto the projection plane. What are the clipped endpoints on the plane?

Let v = P2 - P1 = (-9, -15, -1)

Then r = P1 + t.v represents the line, where t is a parameter.

r = (6-9t, 10-15t, 3-t)

We need to check where it hits each of the planes in turn (I've rearranged them in order of ascending t-values).

i) It intersects z = x when 6-9t = 3-t -> 8t = 3 -> t = 3/8

This is at: (2+5/8, 4+3/8, 2+5/8)

This is above z = y, and so continuing doesn't take us into the viewing pyramid.

ii) It intersects z = y when 10-15t = 3-t -> 14t = 7 -> t = 1/2

This is at: (1+1/2, 2+1/2, 2+1/2)

This is to the left of z = x, so continuing takes us into the viewing pyramid.

iii) It intersects z = -x when 6-9t = t-3 -> 10t = 9 -> t = 9/10

This is at: (-(2+1/10), -(3+1/2), 2+1/10)

Crossing any of the planes will take us out of the viewing pyramid again.

iv) It intersects z = -y when 10-15t = t-3 -> 16t = 13 -> t = 13/16

This is at: (-(1+5/16), -(2+3/16), 2+3/16)

---

So our clipped line segment is from (1.5, 2.5, 2.5) to (-2.1, -3.5, 2.1). Our focus f = 1, since the projection plane is at z = 1.

For each of the two endpoints:

(1.5, 2.5, 2.5) -> (1.5*1/(2.5+1), 2.5*1/(2.5+1)) = (3/7, 5/7)

(-2.1, -3.5, 2.1) -> (-2.1*1/(2.1+1), -3.5*1/(2.1+1)) = (-21/31, -35/31)

(b) Project the line onto the plane, then clip the lines using 2D computations. What are the clipped endpoints on the plane?

To project the line onto the plane, we're going to project its endpoints, and then determine the 2D line which joins the projected points (mainly because this is the easiest way I could think of to do it):

(6,10,3) -> (6*1/(3+1), 10*1/(3+1)) = (3/2, 5/2)

(-3,-5,2) -> (-3*1/(2+1), -5*1/(2+1)) = (-1, -5/3)

Gradient:

-5/3 - 5/2

----------   =   5/3

-1 - 3/2

y + 5/3 = 5/3(x + 1)

3y + 5 = 5x + 5

y = 5x/3 (which was kind of obvious, anyway, from the endpoints)

We clip this against the boundaries: x = 1, x = -1, y = 1, y = -1.

When x = 1, y = 5/3

When x = -1, y = -5/3

When y = 1, x = 3/5

When y = -1, x = -3/5

The clipped endpoints are therefore: (3/5,1) and (-3/5,-1). These are not the same as those generated by the 3D clipping. Of course, this may have been the point the question was trying to make. Or then again, it may not (it may have been trying to make the opposite point, only I messed it up!) Time will tell...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote