Skip to content
Snippets Groups Projects
Commit 52d4fb18 authored by Alexis Girault's avatar Alexis Girault
Browse files

BUG: Update camera clipping range

The camera clipping range was not updated after its position was
changed by the cameraController, resulting in cropped actors by
the 'far' plane if the camera was pulled too far away from the
models.

This commit adresses issue #56
parent 3e6c9b11
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,10 @@ public:
if (this->cameraControllerData != nullptr)
{
updateCamera();
vtkRenderer* renderer =
this->renderWindow->GetRenderers()->GetFirstRenderer();
updateCamera(renderer);
renderer->ResetCameraClippingRange();
}
this->renderWindow->Render();
......@@ -96,10 +99,9 @@ public:
///
/// \brief Update the camera from external source (optional)
///
void updateCamera()
void updateCamera(vtkRenderer* renderer)
{
vtkCamera* camera = getRenderWindow()->GetRenderers()->
GetFirstRenderer()->GetActiveCamera();
vtkCamera* camera = renderer->GetActiveCamera();
camera->SetPosition(
cameraControllerData->position[0],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment