<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 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 becomes a scaling factor.<br><br>So what I want to visualise is X/Z, Y/Z, 1 in (uv coordinate system). <br><br>> From: david.gobbi@gmail.com<br>> Date: Tue, 16 Feb 2010 13:00:08 -0700<br>> Subject: Re: [vtkusers] vtkPoints ...how to work with them.<br>> To: ilferraresebono@hotmail.it<br>> CC: vtkusers@vtk.org<br>> <br>> Show us your transform matrix. I'd bet that when your points are<br>> multiplied by the matrix, the homogeneous coordinate ends up being<br>> zero.<br>> <br>> David<br>> <br>> <br>> On Tue, Feb 16, 2010 at 12:09 PM, Giancarlo Amati<br>> <ilferraresebono@hotmail.it> wrote:<br>> > Hello everybody, this is my code:<br>> ><br>> > vtkSmartPointer<vtkTransformPolyDataFilter> pdF =<br>> > vtkTransformPolyDataFilter::New();<br>> > pdF->SetInputConnection(pdNorm->GetOutputPort());<br>> > pdF->SetTransform(perspT);<br>> > pdF->Update();<br>> ><br>> ><br>> > vtkSmartPointer<vtkPolyData> T_persp_pd = pdF->GetOutput();<br>> > T_persp_pd->Update();<br>> ><br>> > vtkSmartPointer<vtkPoints> T_pdPoints = T_persp_pd->GetPoints();<br>> > cout << "N points: " << T_persp_pd->GetNumberOfPoints();<br>> ><br>> ><br>> > //Normalize the points<br>> > for( int i = 0; i<T_persp_pd->GetNumberOfPoints(); i++) {<br>> > double p[3];<br>> > T_persp_pd->GetPoints()->GetPoint(i,p);<br>> > cout<< "POints i: " << i << " " << p[0] << endl;<br>> > p[0] = p[0]/p[2];<br>> > p[1] = p[1]/p[2];<br>> > p[2] = p[2]/p[2];<br>> > }<br>> ><br>> > when I print out the 3D vector p, I always get: -1.INF0000000000 which is<br>> > clearly a mistake. What's the problem in my code?<br>> ><br>> > thanks a lot!<br>> > Giancarlo<br>> ><br>> > ________________________________<br>> > Troppe caselle di posta? Gestiscile da Hotmail!<br>> > _______________________________________________<br>> > Powered by www.kitware.com<br>> ><br>> > Visit other Kitware open-source projects at<br>> > http://www.kitware.com/opensource/opensource.html<br>> ><br>> > Please keep messages on-topic and check the VTK FAQ at:<br>> > http://www.vtk.org/Wiki/VTK_FAQ<br>> ><br>> > Follow this link to subscribe/unsubscribe:<br>> > http://www.vtk.org/mailman/listinfo/vtkusers<br>> ><br>> ><br>                                            <br /><hr />Ci sai fare con le parole? <a href='http://typectionary.it.msn.com/' target='_new'> Scoprilo su Typectionary!</a></body>
</html>