[vtk-developers] Bug in vtkCamera::Elevation

Xabi Riobe xabivtk at gmail.com
Thu Feb 4 08:54:07 EST 2016


Hi,

There is an issue in vtkCamera::Elevation if the angle is 90.

It is 100% reproductible with VS2013 if compiled in 64bits, otherwise the
rounding epsilon makes it work by chance.

I'm willing to fix it in GitLab but first i would like your opinion about
the best way to do it.

with a simple example of a plane in a renderer, and a call to
renderer->GetActiveCamera()->Elevation(90)

What happens in the call stack of vtkCamera::Elevation :
   vtkCamera::SetPosition()
   vtkCamera::ComputeViewTransform
   vtkPerspectiveTransform::SetupCamera

   vtkMath::Cross(viewUp,viewPlaneNormal,viewSideways);

where viewUp and viewPlaneNormal are both (0,1,0)  so viewSideways is
(0,0,0) leading to bad camera parameters.
Here comes the VS13+64bits configuration case, when with others,
viewSideways is luckily different than 0

What do you think of applying the rotation to the viewUp vector in
vtkCamera::Elevation before the call to SetPosition?
Should we put a warning in vtkPerspectiveTransform::SetupCamera
when vtkMath::Normalize returns 0?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160204/4cb90a6f/attachment.html>


More information about the vtk-developers mailing list