









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!










^ J. Ross Beveridge, January 28, 1999
w^
Ray-to-Surface Intersection Calculations are Key. w^
Algorithms tied to surface type.^ ü Sphere ü Ellipse ü Cylinder ü Cone ü Convex Polygon ü General Polygon ü Bicubic Surfaces w^
First pass:
General Mathematics
w^
Second pass:
Highly Optimized Codes
^ J. Ross Beveridge, January 28, 1999
w^
Defined by a point and a unit vector. w^
The point may be the PRP, w^
It may be the pixel. w^
pix
prp
pix
prp
^ J. Ross Beveridge, January 28, 1999
w^
Expand to see what is happening. Let
x^ c^
x^0 − y^ c^
y^0 − zc^
z^0 = −
s
u^ x u^ y uz
t^ x t^ y t^ z
s
u^ x u^ y uz
t^ x t^ y t^ z
(^2) r
r ⋅^
s u
x^
t^ x − s u
y^
t^ y − s uz
t^ z
s u
x^
t^ x^
2
s u
y^
t^ y^
2
s uz
t^ z^
2
(^2) r
^ J. Ross Beveridge, January 28, 1999
w^
After multiplying out, expand and collect s terms.
u^ x 2
(^2) uz
u^ y 2
(^2) s
2 t
uy^
y^
2 t
ux^
x^
2 t
uzz^
s
(^2) t x
(^2) r
(^2) t z
(^2) t y
w^
2
2
2
^ J. Ross Beveridge, January 28, 1999
Compute the two
s^
values for the two intersections:
s^
r
s^
r
1
2
2
2
2
2
2
2
9 multiplies/squares6 additions1 square root
w^
Compute the actual positions along the ray:^ s^
s^
s
s U
*^
min(
1
2
0
3 multiplies/squares3 additions1 min
^ J. Ross Beveridge, January 28, 1999
w^
Defined by two points, P
and P 0
o^
o
o^
o
o^
o
0
1
0
(^111)
w^
Advantages:^ ü Easier to carry two points between coordinates. ü More general for intersection computaions.
^ J. Ross Beveridge, January 28, 1999
w^
Closest point based upon
t^ values.
w^
Example of ray intersection with a sphere..
r C
r R
√ R
d^
C R D^
dR C
b^
D
a^
b^
r^
a^
r^
b
P^
d^
a R =^ i
⋅
=^
−^
=
+^
=^
⇒^
=^
−
=^
−(
) r r^
r^
r
√^ , √
√
2
2
2
2
2
r D a
d^
a − (^
)^
r
3 multiplies, 2 additions3 multiplies, 3 additions3 multiplies, 2, additions, 1 root1 multiply, 1 addition, 1 root3 multiplies, 1 additions.
^ J. Ross Beveridge, January 28, 1999
w^
Simplify by recognizing some similar triangles.
r C
r R
BySimilar Triangles
and
Solve for
whereand
v^
b^
c^
a^
b^
r
t
t^
v^
a^
v^
C R
a^
r^
b^
t^
v^
r^
b
b^
c^
v^
t^
v^
r^
c^
v
c^
C C
t^
v^
r^
C C
v
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
+^
=^
+^
=
=^
−^
=^
⋅
=^
−^
⇒^
=^
−^
−
=^
−^
⇒^
=^
−^
−^
−
=^
⋅^
⇒^
=^
−^
−^
⋅^
−
r^
r
r^
r^
r^
r
d a
c^
C C =^
r^ r ⋅
r
7 multiplies, 6 additions, 1 square root
t
v
^ J. Ross Beveridge, January 28, 1999
w^
An alternative, and arguably better way is to transform theray into a world in which the ellipsoid is a shere.
t^
t P
k^
x
l^
y m^
z
i^
i
c c c
0
1
0 1
w^
The equation of the Ellipsoid is now transformed:
k^ (
−x x
(^2) c
l^ (
−y y
(^2) c
m^
−z z
(^2) c
(^2) r
x^0
t dx
(^2)
y^0
t dy
(^2)
z^0
t dz
(^2)
(^2) r
^ J. Ross Beveridge, January 28, 1999
w^
For polygonal objects there are two parts.^ ü Find point of intersection P on infinite plane. ü Is point P inside polygon. w^
General equation for a plane in 3D:^ N
n^ x^
x^0
t dx
n^ y^
y^0
t dy
nz^
z^0
t dz
ρ^
n^ x^
dx
n^ y^
dy
nz^
dz
t
n^ x^
x^0
n^ y^
y^0
nz^
z^0
ρ^
=−t
n^ x^
x^0
n^ y^
y^0
nz^
z^0
ρ
n^ x^
dx
n^ y^
dy
nz^
dz
t^
0 1