VtkRenderer error

Hi,
I am getting “Re-setting view-up since view plane normal is parallel” runtime error message arising from …\Rendering\Core\vtkRenderer.cxx line 1175

This error message is showing when I move the outline box to view the top of the box. (screenshot attached)

Capture-vtk

I am using VTK8.2.
Is there any way to suppress/resolve this message?

Thanks.

Hi there,

To achieve that effect one can, for instance, rotate the camera around the box. Do you have code that moves your camera? I’m asking this because I’ve seen camera-moving code lacking a due update of the view-up vector (done via vtkCamera::SetViewUp()) as many people think it is done automatically. My project has such code (e.g. to reset the scene to look down the X axis) and I have always to update it to get it right:

´void View3DWidget::onLookAtXY()
{
    //_renderer->ResetCamera();
    double *fp = _rendererMainScene->GetActiveCamera()->GetFocalPoint();
    double *p = _rendererMainScene->GetActiveCamera()->GetPosition();
    double dist
        = std::sqrt((p[0] - fp[0]) * (p[0] - fp[0]) + (p[1] - fp[1]) * (p[1] - fp[1])
                    + (p[2] - fp[2]) * (p[2] - fp[2]));
    _rendererMainScene->GetActiveCamera()->SetPosition(fp[0], fp[1], fp[2] + dist);
    _rendererMainScene->GetActiveCamera()->SetViewUp(0.0, 1.0, 0.0);
    // redraw the scene
    _vtkwidget->GetRenderWindow()->Render();
}

regards,

Paulo

Many thanks you Paulo.
It worked! :+1:

1 Like

Hello,

I’m glad to help. Here’s the role of the view-up vector if I was not very clear:

As you can see, setting only the camera’s focal point (“orientation” in the figure above) and position is not enough to define the viewing geometry. The view-up vector tells the renderer where the “up” of the camera is pointing to. The view-up vector should, under normal circumstances, be orthogonal to the normal vector of viewing plane (the blue panel in the figure). Setting it parallel to the normal would result in ill-conditioned matrices and divisions by zero in the computations down the rendering pipeline. Hence the VTK error.

take care,

Paulo

1 Like

You have summarized it very clearly and yet so precise :ok_hand:

1 Like