[vtkusers] give direction to cylinder
David Doria
daviddoria at gmail.com
Wed Jul 18 10:22:46 EDT 2012
On Wed, Jul 18, 2012 at 10:07 AM, Gonzalo Amadio <gonzaloamadio at gmail.com>wrote:
> I forgot to put the code, I only add this to the previous one
>
> vtkSmartPointer<vtkTransform> transform =
>> vtkSmartPointer<vtkTransform>::New();
>> transform->RotateY(90);
>>
>
>
> vtkSmartPointer<vtkTransformPolyDataFilter> transF =
>> vtkSmartPointer<vtkTransformPolyDataFilter>::New();
>> transF->SetInput(cylinderSource->GetOutput());
>> transF->SetTransform(transform);
>> transF->Update();
>>
>
>
> vtkSmartPointer<vtkPolyData> cylinder = transF->GetOutput();
>
>
These are transformation it the mathematical sense - i.e. "around the
origin". You'd have to center your data (by subtracting it's center, a
translation to the origin), apply the rotation, and then return your data
to its original position by adding its center (a final translation).
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120718/bb2bf437/attachment.htm>
More information about the vtkusers
mailing list