Ray-Sphere Intersection II
Ray: P = P0 + tV
Sphere: |P - O|2 - r 2 = 0
L = O - P0
tca = L • V
if (tca < 0) return 0
d2 = L • L - tca2
if (d2 > r2) return 0
thc = sqrt(r2 - d2)
t = tca - thc and tca + thc
P0
V
O
P
r
P’
r
d
thc
tca
L
Geometric Method
P = P0 + tV
Previous slide
Next slide
Back to first slide
View graphic version