3
\$\begingroup\$

How can I check it if a line3D/ or ray is intersecting a sphere?

\$\endgroup\$
4
\$\begingroup\$

The real time rendering web-site is good source for different intersection algorithms (including ray/sphere intersection):

http://www.realtimerendering.com/intersections.html

\$\endgroup\$
  • \$\begingroup\$ Except that a ton of the links are down these days. \$\endgroup\$ – Tara May 8 '15 at 0:56
4
\$\begingroup\$

The problem logically reduces to finding the shortest distance between the ray (line) and the sphere centre. If that distance is shorter than the sphere radius, there is an intersection.

Of course, there's a formula for line-point distance.

\$\endgroup\$
0
\$\begingroup\$

It is a part of ray tracer design. Look at the ray and sphere intersection. It is very simple and commonly used in every ray tracer.

\$\endgroup\$
  • \$\begingroup\$ You could have added a link or something at least. \$\endgroup\$ – Tara May 8 '15 at 0:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.