[vtkusers] Translation / TransformDoubleVector() not working ?

Emmanouil Moschidis moshman65 at yahoo.com
Thu Apr 12 06:22:04 EDT 2007


Hello 

i am using the following code in C++... just for clarification i am storing the coordinates of the points in std::vectors... i also use a custom class for 3D points (Pt3D)....

    vtkTransform transform;
    transform.Identity();
    transform.PostMultiply();
    transform.RotateWXYZ(45, X, Y, Z);  //X,Y, Z are the coordinates of the normal of the plane i rotate
    transform.Translate((Origin[0] + Spacing[0]*100),(Origin[1] + Spacing[1]*200),(Origin[2] + Spacing[2]*100));

double* p;
p = transform.TransformDoubleVector(vtkLandmarksBuffer[i].getAll() ); //getAll() returns an array with the coordinates of the point
Pt3D Point3D(p);    //Pt3D is a custom class for 3D Points (x,y,z)
landmarksBuffer.push_back(Point3D);

delete p;

the points with the new coordinates are stored in the landmarksBuffer vector. However when i visualize the result i only see the rotation part of the trasnform
. In fact when i put the rotation in comments then i see no difference in the new points. So for some reason the translation doesn't work at all. Do you know if TransformDoubleVector() method has any kind of problems like that? I know that i should probably choose the polyDataFilter approach but i thought this way could be easier for me...

Any insight is welcome

Thanks 

       
---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070412/b8396208/attachment.htm>


More information about the vtkusers mailing list