vtkOpenGLRenderer (000001FB00382400): Resetting view-up since view plane normal is parallel
I am using vtk 9.0.3. I am trying to set the lateral view using Roll and Pitch of vtkCamera. When I use Pitch > 87 degree I get below warning and view gets reset.
Warning: In ..\Rendering\Core\vtkRenderer.cxx, line 1164 vtkOpenGLRenderer (00000245253A2650): Resetting view-up since view plane normal is parallel
Below is the code
import vtk
reader = vtk.vtkSTLReader()
reader.SetFileName("MiniHumanMandible.stl")
reader.Update()
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputData(reader.GetOutput())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
actor.GetProperty().SetColor(1, 0, 0)
cam = vtk.vtkCamera()
cam.Roll(90)
cam.Pitch(90)
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
ren.AddActor(actor)
ren.SetActiveCamera(cam)
ren.SetBackground(0,0,0)
renWin.AddRenderer(ren)
ren.ResetCamera()
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
style = vtk.vtkInteractorStyleTrackballCamera()
iren.SetInteractorStyle(style)
iren.Start()
I have attached images of default rendered stl file, with Roll 90 and pitch 90 and warning, with Roll 90 and Pitch 87 degree
Original View (Without any camera Roll or Pitch)
Lateral View (With Roll = 90, Pitch = 90) with warning
Lateral View (With Roll = 90, Pitch = 87) no warning
Please help me to resolve this issue
Edited by Mathieu Westphal (Kitware)