<div dir="ltr"><div>The only way I've found to do that is calling win->Render() again after the changes are done. Optimally, you want this to be called once per frame, after all changes have been done. You could set a bool flag like needsUpdating and set it to true if you call Drawing::translate()<br><br></div>I'm not an expert at VTK though, and I also expected at first that the pipeline would know when it needed to be re-rendered. Maybe it has that functionality and I haven't been able to trigger it. If you find out, let us know.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-17 7:58 GMT-03:00 Lonni Besançon <span dir="ltr"><<a href="mailto:lonni.besancon@gmail.com" target="_blank">lonni.besancon@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Turns out I am now using the Actor directly to set rotation translation and<br>
scale. It does work fine except that I need to click on the window for the<br>
changes to appear. Would anyone know the reason why?<br>
Don't know if this is useful but here is my code now:<br>
<br>
void Drawing::translate(float x, float y, float z){<br>
        cout << "Translate: " << x << " - " << " - " << y << " - " << z << endl ;<br>
        vtkSmartPointer<vtkTransform> transform1a =<br>
vtkSmartPointer<vtkTransform>::New();<br>
        //transform1a->Translate(x,y,z);<br>
        //transformFilter->SetTransform(transform1a);<br>
        //transformFilter->Update();<br>
        double* position = mainActor->GetPosition();<br>
        mainActor->SetPosition(position[0]+x,position[1]+y,position[2]+z);<br>
}<br>
<br>
void Drawing::read(){<br>
<br>
        std::string filename = BUNNY;<br>
        // Read all the data from the file<br>
        vtkSmartPointer<vtkXMLPolyDataReader> reader<br>
=vtkSmartPointer<vtkXMLPolyDataReader>::New();<br>
        reader->SetFileName(filename.c_str());<br>
        reader->Update();<br>
        inputPolyData = reader->GetOutput();<br>
<br>
        cout << "File Found and Loaded : " << filename << endl ;<br>
<br>
        vtkSmartPointer<vtkTransform> translation =<br>
vtkSmartPointer<vtkTransform>::New();<br>
        translation->Translate(0.3, -0.05, 0);<br>
        transformFilter = vtkSmartPointer<vtkTransformPolyDataFilter>::New();<br>
        //transformFilter->SetInputConnection(reader->GetOutputPort());<br>
        transformFilter->SetInputData(inputPolyData);<br>
        transformFilter->SetTransform(translation);<br>
        //transformFilter->Update();<br>
<br>
        vtkSmartPointer<vtkPolyDataMapper> mapper =<br>
vtkSmartPointer<vtkPolyDataMapper>::New();<br>
        mapper->SetInputConnection(transformFilter->GetOutputPort());<br>
<br>
        mainActor = vtkSmartPointer<vtkActor>::New();<br>
        mainActor->SetMapper(mapper);<br>
<br>
        ren->AddActor(mainActor);<br>
<br>
        vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br>
        iren->SetRenderWindow(win);<br>
        vtkInteractorStyleMultiTouchCamera *style =<br>
        vtkInteractorStyleMultiTouchCamera::New();<br>
        iren->SetInteractorStyle(style);<br>
<br>
        //Start the event loop<br>
        iren->Initialize();<br>
        iren->Start();<br>
<br>
        defineClipping();<br>
        win->PolygonSmoothingOn();<br>
        win->Render();<br>
        win->Start();<br>
}<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Rotation-of-PolyData-tp5732340p5732400.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/Rotation-of-PolyData-tp5732340p5732400.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>