Examples » ArcBall Camera new in Git master

Intuitive camera control with smooth navigation.

Image

This is an implementation of Ken Shoemake's arcball camera with smooth navigation feature. Using arcball, the camera control is more accurate and consistent. See also the Mouse Interaction example for an alternative approach.

Controls

  • mouse drag rotates the camera
  • Shift mouse drag pans the camera
  • mouse wheel zooms in/out
  • R resets the camera to its original position
  • L toggles lagging (smooth camera navigation)

Credits

This example was originally contributed by Nghia Truong.

Source

Full source code is linked below and also available in the magnum-examples GitHub repository. The ArcBall.h and ArcBall.cpp files are completely standalone, depending only on the Math library, and ready to be integrated into your project. The ArcBallCamera.h file provides an optional SceneGraph integration that you can but don't have to use.