[vtkusers] VectorText rotating center

Cory Quammen cory.quammen at kitware.com
Wed Sep 16 09:11:05 EDT 2015


Hi Dejan,

You'll have to compute the center of the text source (available by getting
the bounds of the m_TextSource) and shifting the actor so that the center
is at the world center, rotate, then shift back.

Hope that helps,
Cory

On Wed, Sep 16, 2015 at 6:11 AM, Dejan Zivkovic <dejan.zivkovic90 at gmail.com>
wrote:

> Hi,
>
> I would like to have VectorText that is rotation around its central
> vertical axis.
>
> I wrote some code like this:
>
> *vtkSmartPointer<vtkVectorText> m_TextSource =
> vtkSmartPointer<vtkVectorText>::New();*
> *m_TextSource->SetText("3DIA");*
> *m_TextSource->Update();*
>
> *vtkSmartPointer<vtkPolyDataMapper> m_Mapper =
> vtkSmartPointer<vtkPolyDataMapper>::New();*
> *m_Mapper->SetInputConnection(m_TextSource->GetOutputPort());*
>
> *vtkSmartPointer<vtkActor> **m_Actor = vtkSmartPointer<vtkActor>::New();*
> *m_Actor->GetProperty()->SetColor(1.0, 1.0, 1.0);*
> *m_Actor->SetMapper(m_Mapper);*
> *m_Actor->RotateY(2.0);*
>
> and this way the text rotates around the world center.
> How to move the center of rotation to the center of the text?
>
> Thanks,
> Dejan Zivkovic
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>


-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150916/0a21dd30/attachment.html>


More information about the vtkusers mailing list