[vtkusers] give direction to cylinder
Gonzalo Amadio
gonzaloamadio at gmail.com
Wed Jul 18 10:07:45 EDT 2012
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();
2012/7/18 Gonzalo Amadio <gonzaloamadio at gmail.com>
> That seems to work. But I have another problem now.
>
> When I rotate the cylinder, the center don't remain in the original
> position where it is set.
>
> Trying to being more clear, imagine my original cylinder is a clock hand
> pointing to number three. so the center is between the center of the clock
> and number three. When I rotate it for example 90, the hand is pointing to
> number twelve, so the center is not more between the center of the clock
> and number 3, instead is between center and number 12.
>
> Thank you for helping!
>
>
> 2012/7/18 David Doria <daviddoria at gmail.com>
>
>> On Wed, Jul 18, 2012 at 7:14 AM, Gonzalo Amadio <gonzaloamadio at gmail.com>wrote:
>>
>>> Thank you for the response..
>>>
>>> I am reading this : http://www.vtk.org/doc/release/5.6/html/a02007.html that
>>> I think is what I need. Because I don't have all the mapper and actor part
>>> and as it is said there, if I am not understanding wrong, vtkTransfrom work
>>> on the actor and rendering part, and vtkTransformPolyDataFilter directly on
>>> the rotation of the figure itself :
>>>
>>> " The difference between the two methods is that vtkActor's
>>>> transformation simply effects where objects are rendered (via the graphics
>>>> pipeline), whereasvtkTransformPolyDataFilter<http://www.vtk.org/doc/release/5.6/html/a02007.html> actually
>>>> modifies point coordinates in the visualization pipeline"
>>>
>>>
>> That is correct:
>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filters/TransformPolyData
>>
>> David
>>
>
>
>
> --
> --------
> Gonzalo Amadio
>
>
--
--------
Gonzalo Amadio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120718/5b6d8c3c/attachment.htm>
More information about the vtkusers
mailing list