Ray and Object Intersections: Truncated Cone
by Otto Wilke otto_wilke@hotmail.com
I am vaguely aware that graphics is normally done with vector operations, generic
solids positioned at the origin, and transformation matrices to move rays to and fro.
I thought it would be interesting to use rectangular coordinates and objects located
anywhere in space and oriented in any direction.
This is one of four files covering the plane, the sphere, the cylinder, and the cone.
Let C be a truncated right circular cone. Let the larger circular end be centered at
P1(x1,y1,z1) and have radius R. Let the smaller circular end be centered at
P2(x2,y2,z2) and have radius r. Let P(x,y,z) be some point on the surface of the cone.
Let P3(x3,y3,z3) be a point on line segment P1 P2 such that line segment P P3 is
perpendicular to P1 P2. Let d1 be distance P1 P2. Let d2 be distance P P1.
Let d3 be distance P P2. Let d4 be distance P P3. Let d5 be distance P1 P3.
Let d6 be distance P2 P3. By the distance formula.
Warning, the name changecoords has been redefined
I think I remember that
By the Pythagorean Theorem
Solving for d4
Knowing d4 must be positive, d4 is
The area of triangle P P1 P2 is half of the product of base and height
By Heron's formula, the area squared is also
Setting the squares of the area equal to each other
Inserting the desired value of d4
Substituting for d1, d2, and d3
The equation immediately above give the coordinates of points on the truncated cone.
Let's graph a specific cone.
What we see is a series of cones on the same axis, with some plotted points beyond
the ends of the original truncated cone. To find the intersection of a ray and the truncated
cone, we need to find only points on the truncated cone. This is ensured by the following
inequalities.
Let L be a line on point P4(x4,y4,z4) and let L have direction numbers a, b, and c. The parametric equations for L are
Let's pick P4 as (0,0,0) and a=.5, b=2, c=.5.
Now that we have equations for points on a line and a cone and two inequalities, we'll ask Maple to solve the simlutaneous equations and inequalities.
The ray pierces the cone, entering and exiting. To determine when a ray hits one or both
circular ends, use the same procedure as was used for the cylinder.