[vtkusers] Re: Simple Collision Detection between camera and object
Goodwin Lawlor
goodwin.lawlor at ucd.ie
Wed Jan 31 07:57:29 EST 2007
Chris Hughes wrote:
> Hi Guys,
>
> I have a simple scene with a single vtkActor containing polyData and a
> vtkCamera. I am looking for a simple way to be able to tell if the
> camera (which I obviously know the position of) is touching the polygon
> mesh.Ie does the polygon mesh appear at the coordinates of the camera?
>
> I am sure that there must be an easy solution to this, but I am not sure
> where to start!
>
> Many thanks,
>
> Chris
>
Hi Chris,
You could use:
int vtkOBBTree::InsideOrOutside (const double point[3])
within a callback to check if the camera position has penetrated your
polydata mesh.
hth
Goodwin
More information about the vtkusers
mailing list