<div class="gmail_quote">On Fri, Jul 22, 2011 at 5:43 AM, Jothy <span dir="ltr"><<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi all,<br>
<br>
I have a vtkPolyData (generated from vtkDiscreteMarchingCubes) and I<br>
need to find out the points inside this 3D polygon. I looked at this<br>
example in wiki<br>
<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/PointInPolygon" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/PointInPolygon</a>.<br>
<br>
I tried to calculate the normal like<br>
<br>
vtkSmartPointer<vtkPolygon> polygon =<br>
vtkSmartPointer<vtkPolygon>::New();<br>
double n[3];<br>
//pd=vtkPolyData (mesh)<br>
polygon->ComputeNormal(pd->GetPoints()->GetNumberOfPoints(),<br>
static_cast<double*>(pd->GetPoints()->GetData()->GetVoidPointer(0)),<br>
n);<br>
<br>
but qDebug()<<n;//similar to std::cout<br>
<br>
it prints a hexadecimal number.<br>
<br>
I don't understand how to do this correctly.<br>
<br>
Also, should I calculate this normal for each point I am testing.<br>
<br>
Thanks<br>
<br>
Jothy<br></blockquote><div><br></div><div>'n' is an array, so the hex number you are seeing is a memory address of the first element of n.</div><div><br></div><div>You should see what you expect with</div><div><br>
</div><div>cout << n[0] << " " << n[1] << " " << n[2];</div><div><br></div><div>David </div></div>