<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi David,<br><br>well&nbsp; my transformation matrix is aprojection matrix (3x4) but I add a 4th row which is null. So basically my matrix is:<br><br>a b c d<br>e f g h<br>j i j k<br>0 0 0 0<br><br>As I need to transform 3D points into my 2D image space.<br>now, as I need to dived X,Y by Z which&nbsp; becomes a scaling factor.<br><br>So what I want to visualise is X/Z, Y/Z, 1 in (uv coordinate system). <br><br>&gt; From: david.gobbi@gmail.com<br>&gt; Date: Tue, 16 Feb 2010 13:00:08 -0700<br>&gt; Subject: Re: [vtkusers] vtkPoints ...how to work with them.<br>&gt; To: ilferraresebono@hotmail.it<br>&gt; CC: vtkusers@vtk.org<br>&gt; <br>&gt; Show us your transform matrix.  I'd bet that when your points are<br>&gt; multiplied by the matrix, the homogeneous coordinate ends up being<br>&gt; zero.<br>&gt; <br>&gt;    David<br>&gt; <br>&gt; <br>&gt; On Tue, Feb 16, 2010 at 12: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 />Ci sai fare con le parole? <a href='http://typectionary.it.msn.com/' target='_new'> Scoprilo su Typectionary!</a></body>
</html>