<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Bill,<br><br>Thanks for the suggestion. Very appreciated.<br>that might solve some other bugs I had.<br><br>Giancarlo<br><br>&gt; Date: Wed, 17 Feb 2010 11:17:56 -0500<br>&gt; Subject: Re: [vtkusers] vtkPoints ...how to work with them.<br>&gt; From: bill.lorensen@gmail.com<br>&gt; To: ilferraresebono@hotmail.it<br>&gt; CC: vtkusers@vtk.org<br>&gt; <br>&gt; Not related to your error, but,<br>&gt; vtkSmartPointer&lt;vtkTransformPolyDataFilter&gt; pdF =<br>&gt; vtkTransformPolyDataFilter::New();<br>&gt; should be<br>&gt; vtkSmartPointer&lt;vtkTransformPolyDataFilter&gt; pdF =<br>&gt; vtkSmartPointer&lt;vtkTransformPolyDataFilter&gt;::New();<br>&gt; <br>&gt; With the current code, you will generate memory leaks.<br>&gt; <br>&gt; On Tue, Feb 16, 2010 at 2:09 PM, Giancarlo Amati<br>&gt; &lt;ilferraresebono@hotmail.it&gt; wrote:<br>&gt; &gt; Hello everybody, this is my code:<br>&gt; &gt;<br>&gt; &gt; vtkSmartPointer&lt;vtkTransformPolyDataFilter&gt; pdF =<br>&gt; &gt; vtkTransformPolyDataFilter::New();<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pdF-&gt;SetInputConnection(pdNorm-&gt;GetOutputPort());<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pdF-&gt;SetTransform(perspT);<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pdF-&gt;Update();<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; &nbsp;vtkSmartPointer&lt;vtkPolyData&gt; T_persp_pd = pdF-&gt;GetOutput();<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; T_persp_pd-&gt;Update();<br>&gt; &gt;<br>&gt; &gt; &nbsp;vtkSmartPointer&lt;vtkPoints&gt; T_pdPoints = T_persp_pd-&gt;GetPoints();<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cout &lt;&lt; "N points: " &lt;&lt; T_persp_pd-&gt;GetNumberOfPoints();<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //Normalize the points<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for( int i = 0; i&lt;T_persp_pd-&gt;GetNumberOfPoints(); i++) {<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; double p[3];<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; T_persp_pd-&gt;GetPoints()-&gt;GetPoint(i,p);<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cout&lt;&lt; "POints i: " &lt;&lt; i &lt;&lt; " " &lt;&lt; p[0] &lt;&lt; endl;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; p[0] = p[0]/p[2];<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; p[1] = p[1]/p[2];<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; p[2] = p[2]/p[2];<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&gt; &gt;<br>&gt; &gt; when I print out the 3D vector p, I always get: -1.INF0000000000 which is<br>&gt; &gt; clearly a mistake. What's the problem in my code?<br>&gt; &gt;<br>&gt; &gt; thanks a lot!<br>&gt; &gt; Giancarlo<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt; Troppe caselle di posta? Gestiscile da Hotmail!<br>&gt; &gt; _______________________________________________<br>&gt; &gt; Powered by www.kitware.com<br>&gt; &gt;<br>&gt; &gt; Visit other Kitware open-source projects at<br>&gt; &gt; http://www.kitware.com/opensource/opensource.html<br>&gt; &gt;<br>&gt; &gt; Please keep messages on-topic and check the VTK FAQ at:<br>&gt; &gt; http://www.vtk.org/Wiki/VTK_FAQ<br>&gt; &gt;<br>&gt; &gt; Follow this link to subscribe/unsubscribe:<br>&gt; &gt; http://www.vtk.org/mailman/listinfo/vtkusers<br>&gt; &gt;<br>&gt; &gt;<br>                                               <br /><hr />Troppe caselle di posta? <a href='http://www.windowslive.it/hotmail/GestisciAltriAccount.aspx' target='_new'>Gestiscile da Hotmail!</a></body>
</html>