[vtkusers] Simple vtkParametricTorus question

David Doria daviddoria+vtk at gmail.com
Wed Sep 15 13:30:17 EDT 2010


On Wed, Sep 15, 2010 at 1:23 PM, Haider Syed <hsyed88 at gmail.com> wrote:

> I have set up a very basic vtkParametricTorus and can't figure out how to
> move the "center" of the torus to an x,y,z location of my choice.
>
> vtkParametricTorus *torus=vtkParametricTorus::New();
>     torus->SetRingRadius(tumor_rad);
>     torus->SetCrossSectionRadius(0.00028);
>
>     vtkParametricFunctionSource *ptorus=vtkParametricFunctionSource::New();
>     ptorus->SetParametricFunction(torus);
>
>     vtkPolyDataMapper *torusMapper=vtkPolyDataMapper::New();
>     torusMapper->SetInput(ptorus->GetOutput());
>
>     vtkActor *torusActor=vtkActor::New();
>     torusActor->SetMapper(torusMapper);
>
> Please help.
>
> Thanks,
> Haider
>
> You can create a vtkTransform and apply it with vtkTransformFilter. Here is
an example of the setup:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/TransformFilter

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100915/d5aaa701/attachment.htm>


More information about the vtkusers mailing list