Albert Alises
2017-02-24 12:13:04 UTC
Hello everyone,
I am having trouble rendering the update of a vtkCamera on a
QMitkRenderWindow. I have a renderWindow which looks at a given scene. I
get its associated *vtkRenderWindow *and from it, the *ActiveCamera() *(Which
is a vtkCamera object).
I then modify the position and the view of that camera by doing that:
currentCamera->SetPosition(0.0,0.0,0.0);
currentCamera->SetViewUp(1.0,0.0,0.0);
currentCamera->SetFocalPoint(0.7, 0.3, 0.4);
vtkTransform* translationToPoint = vtkTransform::New();
translationToPoint->Translate(40, 20, 30);
currentCamera->ApplyTransform(translationToPoint);
After applying these transformations, the renderwindow turns black, which
suggests that the render has not been updated. I have tried:
currentCamera->Modified();
this->RequestRenderWindowsUpdate();
Paint method of the Base Renderer from MITK
vtkRenderWindow->Update();
and rendering the camera, render windows, renderer associated.... None of
them is working though.... However, the rendering is updated correctly when
scrolling on the window with the mouse. Which method is the correct one to
call for the window to show the new scene after modifying the vtkCamera
associated to a the window? (the one the WheelEvent method on the
QMitkRenderWindows seems to call).
Thank you very much,
Albert.
I am having trouble rendering the update of a vtkCamera on a
QMitkRenderWindow. I have a renderWindow which looks at a given scene. I
get its associated *vtkRenderWindow *and from it, the *ActiveCamera() *(Which
is a vtkCamera object).
I then modify the position and the view of that camera by doing that:
currentCamera->SetPosition(0.0,0.0,0.0);
currentCamera->SetViewUp(1.0,0.0,0.0);
currentCamera->SetFocalPoint(0.7, 0.3, 0.4);
vtkTransform* translationToPoint = vtkTransform::New();
translationToPoint->Translate(40, 20, 30);
currentCamera->ApplyTransform(translationToPoint);
After applying these transformations, the renderwindow turns black, which
suggests that the render has not been updated. I have tried:
currentCamera->Modified();
this->RequestRenderWindowsUpdate();
Paint method of the Base Renderer from MITK
vtkRenderWindow->Update();
and rendering the camera, render windows, renderer associated.... None of
them is working though.... However, the rendering is updated correctly when
scrolling on the window with the mouse. Which method is the correct one to
call for the window to show the new scene after modifying the vtkCamera
associated to a the window? (the one the WheelEvent method on the
QMitkRenderWindows seems to call).
Thank you very much,
Albert.