[vtkusers] vtkTransform::MultiplyPoint() ... Mysterious behavior !

Rasmus Reinhold Paulsen rrp at imm.dtu.dk
Tue May 20 09:55:57 EDT 2003


Hey David (and Seb),

There is some mystical things lurking in the darkest corners of VTK
though. This is a comment from vtkIterativeClosestPointTransform.cxx :

...
// - points2 could have been avoided, but do not ask me why 
//   InternalTransformPoint is not working correctly on my computer when
//   in and out are the same pointer.
...

I do not know if that comment originates from you or Tim Hutton, but it is
spooky!

Cheers2,
Rasmus


On Tue, 20 May 2003, David Gobbi wrote:

> Hi Sebastien,
> 
> Note that MultiplyPoint is only meant to be used on homogeneous
> coordinates:
> 
>   void MultiplyPoint(const float in[4], float out[4]);
> 
> You should use TransformPoint() instead.
> 
> Cheers,
>  - David
> 
> -- 
>   David Gobbi, MSc                dgobbi at imaging.robarts.ca
>   Advanced Imaging Research Group
>   Robarts Research Institute, University of Western Ontario
> 
> On Tue, 20 May 2003, Sebastien Auclair wrote:
> 
> > Greetings !
> >
> > A wish to apply a transformation filter to the points of a PolyData.
> > If i simply do :
> >
> > for (int i = 0; i < pointCount;
> > {
> >         temp = m_polydata->GetPoint( i );
> >         transform->MultiplyPoint (buffer,buffer);
> > }
> > Only half (or so) of the points will be modified !!! And the transformation is a translation that should modifiy all points.
> >
> > But if i do something "Time Cousuming" like :
> >
> > for (int i = 0; i < pointCount; i++){
> >         temp = m_polydata->GetPoint( i );
> >         buffer [0] = (temp)[0];
> >         buffer [1] = (temp)[1];
> >         buffer [2] = (temp)[2];
> >         transform->MultiplyPoint (buffer,buffer);
> >
> >         (temp)[0] = buffer [0];
> >         (temp)[1] = buffer [1];
> >         (temp)[2] = buffer [2];
> > }
> >
> > Then it works !!!!
> >
> > Anyone knows why ?
> >
> > Thanks !




More information about the vtkusers mailing list