MES Math Tutorials

Free math tutorials by Math Easy Solutions.

Putting 3D in Perspective Question 1: What Points Should Be Clipped?

View on YouTube ↗

A section of Laboratory Project: Putting 3D in Perspective: the full video with all its notes is on that page.

Notes: Putting 3D in Perspective Question 1: What Points Should Be Clipped?

Written notes — from Laboratory Project: Putting 3D in Perspective.

Question 1

Suppose the screen is represented by a rectangle in the yz-plane with vertices (0, ±400, 0) and (0, ±400, 600), and the camera is placed at (1000, 0, 0).

A line L in the scene passes through the points (230, -285, 102) and (860, 105, 264).

At what points should L be clipped by the clipping planes?

Solution:

Let's first graph out the information we are given using the amazing GeoGebra 3D graphing calculator.

https://www.geogebra.org/calculator/twezjbu5

image.png

image.png

image.png Thus we need to determine the points on L which are beyond the projected planes from the camera to the edges of the screen, and hence need to be "clipped" out.

This means we need to determine the 4 clipping planes, which we can see below.

image.png

Next, we will need to determine the equations of the Line and the Clipping Planes.

Recall the equation of Lines & Planes.

image.png

Equation of the 3D Line

Using the given two points of the line, we can thus determine the vector equation of the line and then the parametric equations of the line:

image.png

Equation of the Right Clipping Plane

The right clipping plane can be determined by first obtaining its normal vector, which can be determined as the cross product of the line that extends from the Camera to a corner and the vertical line connecting that corner.

image.png

image.png

Note that I chose the simplified vectors since all that is important is the direction of the vectors and not the magnitude or sign.

Now we can plug in the normal vector and a point on the plane into the vector equation of a plane to determine the linear equation of the right clipping plane.

image.png

Now we need to determine if the line L crosses the right clipping plane by plugging in our parametric equations of a line into the linear equation of a plane and solving for the parameter t.

image.png Calculation Check:

https://www.wolframalpha.com/input?i=solve+for+t%3A+2%28230%2B630t%29+%2B5%28-285%2B390t%29%3D2000

image.png

2965/5 = 593 3210/5 = 642

2965/3210 = 0.9237 593/642 = 0.9237

Thus plugging our value of the parameter t into the line L, we obtain the point where it needs to be clipped on the right clipping plane:

x = 230 + 630 * 593/642 = 811.9159 y = -285 + 390 * 593/642 = 75.2336 z = 102 + 162 * 593/642 = 251.6355

Plotting all this out in the GeoGebra 3D graphing calculator we can see where the line gets clipped! #Amazing

https://www.geogebra.org/calculator/twezjbu5

image.png

image.png

Equation of the Top Clipping Plane

Let's follow the same procedure to find the top clipping plane, and where the line intersects.

image.png

image.png

image.png

Calculation Check:

https://www.wolframalpha.com/input?i=solve+for+t%3A+3%28230%2B630t%29+%2B5%28102%2B162t%29%3D3000

image.png

Plugging in our value of t into the line we get:

x = 230 + 630 * 2/3 = 650
y = -285 + 390 * 2/3 = -25 z = 102 + 162 * 2/3 = 210

Graphing this out we get:

https://www.geogebra.org/calculator/twezjbu5

image.png

image.png Note that clipping at the top plane (A) means we don't need to clip again at the right clipping plane (B).

Equation of the Left Clipping Plane

By symmetry, the left clipping plane is the same as the right clipping plane but every y is replaced by -y.

image.png

image.png

Calculation Check:

https://www.wolframalpha.com/input?i=solve+for+t%3A+2%28230%2B630t%29+-5%28-285%2B390t%29%3D2000

image.png

1/6 = 0.1667 115/690 = 0.1667

115/5 = 23 690/5 = 138 138 / 23 = 6

(523)/(523*6) = 0.1667

Plugging in our value of t into the parametric equations of the line we get:

x = 230 + 630 * (-1/6) = 125 y = -285 + 390 * (-1/6) = -350 z = 102 + 162 * (-1/6) = 75

Graphing this out we get:

https://www.geogebra.org/calculator/twezjbu5

image.png

image.png

Equation of the Bottom Clipping Plane

The bottom clipping plane is just the xy-plane, which is just the set of all values where z = 0; hence that is our clipping plane.

image.png

Plugging in our value of t into the line we get:

x = 230 + 630 * (-51/81) = -166.6667 y = -285 + 390 * (-51/81) = -530.5556 z = 102 + 162 * (-51/81) = 0

Graphing this out we get:

https://www.geogebra.org/calculator/twezjbu5

image.png

image.png

Summary

The line passes through only two clipping planes, the top one (at point A) and the left side (at point C):

https://www.geogebra.org/calculator/twezjbu5

image.png Thus the line gets clipped at the points:

On the Top Clipping Plane at the point (650, -25, 210).

On the Left Clipping Plane at the point (125, -350, 75).



Notes originally posted on the Hive blockchain →
Notes retrieved from the Hive blockchain (Laboratory Project: Putting 3D in Perspective, October 19, 2023).
Comments
Advertisement