Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 740
    • Issues 740
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 198
    • Merge requests 198
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTK
  • VTKVTK
  • Issues
  • #9740
Closed
Open
Created Oct 19, 2009 by Kitware Robot@kwrobotOwner

vtkInteractorStyleTerrain generates errors "Resetting view-up since view plane normal is parallel"

This issue was created automatically from an original Mantis Issue. Further discussion may take place here.


When you look down the "north pole" with the Terrain interactor style, you get a lot of warning messages like so:

Warning: In /opt/vtk_5_4_2/VTK/Rendering/vtkRenderer.cxx, line 1051 vtkOpenGLRenderer (0x9dff598): Resetting view-up since view plane normal is parallel

In vtkRenderer.cxx, there is this test: vup = this->ActiveCamera->GetViewUp(); if ( fabs(vtkMath::Dot(vup,vn)) > 0.999 ) { vtkWarningMacro(<<"Resetting view-up since view plane normal is parallel"); this->ActiveCamera->SetViewUp(-vup[2], vup[0], vup[1]); }

So, vtkRenderer.cxx starts to panic when the dot > 0.999, which I will show happens before the Terrain's limit of 179 degrees.

There is code in vtkInteractorStyleTerrain that, quote:

// Move the camera. // Make sure that we don't hit the north pole singularity.

but, it does not do the job well enough. This is the code that avoids the singularity:

double angle = vtkMath::DegreesFromRadians( acos(vtkMath::Dot( dop, vup) ) ); if ( ( angle + e ) > 179.0 || ( angle + e ) < 1.0 ) { e = 0.0; }

I added some printouts after this code: cout << "dot " << fabs(vtkMath::Dot( dop, vup)) << " angle+e = " << angle << " + " << e << " = " << angle+e << endl;

Note, the dot represents the past, angle+e represents the future.

I saw these messages as i rotated towards the north pole:

dot 0.997361 angle+e = 175.836 + 0.640569 = 176.477 dot 0.99811 angle+e = 176.477 + 0.640569 = 177.117 dot 0.998735 angle+e = 177.117 + 0.640569 = 177.758 Warning: In /opt/vtk_5_4_2/VTK/Rendering/vtkRenderer.cxx, line 1051 vtkOpenGLRenderer (0x9dff598): Resetting view-up since view plane normal is parallel dot 0.999235 angle+e = 177.758 + 0.640569 = 178.399

So, dot=0.999234 after 0.640569 was added to 177.117 to get angle=178.399

We have not reached 179 degrees and we have surpassed dot=0.999234.

So the solution appears to be either change vtkRenderer.cxx's limit to 0.9999 or high (keep adding 9's), OR to change the Terrain's test to 2 and 178 degrees.

Assignee
Assign to
Time tracking