<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Yes there is :</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>try to read about cell locator, and point
locator</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>here is a snippet :</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>//------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>// here i got a xyz surface, y=height. I want to
find height at a specified point of yourpolydata</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> vtkCellLocator *cellLocator =
vtkCellLocator::New();<BR> cellLocator->SetDataSet(yourpolydata);<BR> cellLocator->CacheCellBoundsOn();<BR> cellLocator->SetTolerance(0.0);<BR> cellLocator->AutomaticOn();<BR> cellLocator->BuildLocator();<BR> <BR> float
myPoint[3]={yourx,whatever, yourz};</FONT></DIV>
<DIV><FONT face=Arial size=2> float a0[3], a1[3], x[3],
pcoords[3];<BR></DIV>
<DIV></FONT><FONT face=Arial size=2> // from
a0<BR> a0[0]=myPoint[0];<BR> a0[1]=-10000;<BR> a0[2]=myPoint[2];<BR> </FONT></DIV>
<DIV><FONT face=Arial size=2> // to
a1<BR> a1[0]=myPoint[0];<BR> a1[1]=10000;<BR> a1[2]=myPoint[2];<BR> <BR> // ray
cast<BR> cellLocator->IntersectWithLine(a0,a1,0.0,t,x,pcoords,subId);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> //get new altitude for this point</DIV>
<DIV> myPoint[1]=x[1];<BR></DIV>
<DIV>//-----------------------------------------------------------------------------------------------------------------------------------------<BR></DIV></FONT>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=alexandre.gouaillard@insa-lyon.fr
href="mailto:alexandre.gouaillard@insa-lyon.fr">alexandre gouaillard</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=vtkusers@public.kitware.com
href="mailto:vtkusers@public.kitware.com">vtkusers@public.kitware.com</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, June 14, 2002 2:38 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [vtkusers] Raycast</DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR></DIV>
<DIV><FONT face=Arial size=2>hi everyone</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have an origin point, a direction (vector), and
I 'd like to find the first intersection with a given mesh
(polydata).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I tried to take a look at raycasting method in
vtk , but they all deal with volume rendering issues.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Is there anything allready written in VTK to do
this , or any class/method which could give me a hint on how to do this
?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>thanks in advance.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>alex</FONT></DIV></BLOCKQUOTE></BODY></HTML>