# VtkRenderer error

**URL:** https://discourse.vtk.org/t/vtkrenderer-error/6143
**Category:** Support
**Created:** [July 6, 2021, 7:50pm UTC](https://discourse.vtk.org/t/vtkrenderer-error/6143 "2021-07-06T19:50:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Synfony](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/b5a626/32.png) [@Synfony](https://discourse.vtk.org/u/Synfony)
#### Post date: [July 6, 2021, 7:50pm UTC](https://discourse.vtk.org/t/vtkrenderer-error/6143/1 "2021-07-06T19:50:47Z")

</div>

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](https://discourse.vtk.org/uploads/default/original/2X/3/391785e4eab9e40a5791d46a9a38faef634d110d.png)

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

Thanks.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [July 7, 2021, 6:12pm UTC](https://discourse.vtk.org/t/vtkrenderer-error/6143/2 "2021-07-07T18:12:09Z")

</div>

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:

```cpp
´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

---

<div class="post-metadata">

### Author: ![Synfony](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/b5a626/32.png) [@Synfony](https://discourse.vtk.org/u/Synfony)
#### Post date: [July 8, 2021, 3:46am UTC](https://discourse.vtk.org/t/vtkrenderer-error/6143/3 "2021-07-08T03:46:04Z")

</div>

Many thanks you Paulo.  
It worked! 👍

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [July 8, 2021, 12:49pm UTC](https://discourse.vtk.org/t/vtkrenderer-error/6143/4 "2021-07-08T12:49:35Z")

</div>

Hello,

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

 ![image](https://discourse.vtk.org/uploads/default/original/2X/5/53cd2932cea3b9aa4e9571e350c8e9d01c97e2fb.jpeg)

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

---

<div class="post-metadata">

### Author: ![Synfony](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/b5a626/32.png) [@Synfony](https://discourse.vtk.org/u/Synfony)
#### Post date: [July 8, 2021, 3:23pm UTC](https://discourse.vtk.org/t/vtkrenderer-error/6143/5 "2021-07-08T15:23:44Z")

</div>

You have summarized it very clearly and yet so precise 👌
