[vtkusers] computing ray-sphere intersection

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Mon Mar 26 14:17:01 EST 2001


>Is there a VTK class that uses or provides a method for computing the
>intersection of a ray and a sphere?

Not directly as there is no vtkCell derivative like vtkSphere, but if your 
sphere is a polygon mesh, then use vtkCellLocator and IntersectWithLine

Failing that, you can put together a ray/object test for sphere and 
cylinder quite easily as the intersection tests are well known

>Is there a VTK method for computing the intersection of a ray and a
>cylinder?

see Graphics Gems for example of any one of many raytracing sites for code

JB





More information about the vtkusers mailing list