<!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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>here is a snippet :</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;vtkCellLocator *cellLocator = 
vtkCellLocator::New();<BR>&nbsp;cellLocator-&gt;SetDataSet(yourpolydata);<BR>&nbsp;cellLocator-&gt;CacheCellBoundsOn();<BR>&nbsp;cellLocator-&gt;SetTolerance(0.0);<BR>&nbsp;cellLocator-&gt;AutomaticOn();<BR>&nbsp;cellLocator-&gt;BuildLocator();<BR>&nbsp;<BR>&nbsp;float 
myPoint[3]={yourx,whatever, yourz};</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;float a0[3], a1[3], x[3], 
pcoords[3];<BR></DIV>
<DIV></FONT><FONT face=Arial size=2>&nbsp; // from 
a0<BR>&nbsp;&nbsp;a0[0]=myPoint[0];<BR>&nbsp;&nbsp;a0[1]=-10000;<BR>&nbsp;&nbsp;a0[2]=myPoint[2];<BR>&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;// to 
a1<BR>&nbsp;&nbsp;a1[0]=myPoint[0];<BR>&nbsp;&nbsp;a1[1]=10000;<BR>&nbsp;&nbsp;a1[2]=myPoint[2];<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;//&nbsp;ray 
cast<BR>&nbsp;&nbsp;cellLocator-&gt;IntersectWithLine(a0,a1,0.0,t,x,pcoords,subId);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; //get new altitude for this point</DIV>
<DIV>&nbsp;&nbsp;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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>thanks in advance.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>alex</FONT></DIV></BLOCKQUOTE></BODY></HTML>