Version 5 (modified by Torben Dannhauer, 14 years ago) (diff)


Camera Control


osgVisual provides several approaches to control the camera (point of view). Independent from the selected driver the cluster modul transfer this camera position to all slaves, which modify their field of view according to the master view and their configured camera offset. All camera control mechanism are implemented as camera manipulator. This way it is easy to change between them during runtime.

The camera can be controlled via:

  1. All standart osg Manipulators like flight, terrain, spherical, nodetracker
  2. A Spacenavigator ( based manipulator
  3. A Spacenavigator based Nodetrackermanipulator.
  4. Object position in the scene
  5. External Link

Standart OSG manipulators

It is possible to move the camera inside the application wich OSG's default manipulators. This could be useful for demonstration purposes.

Spacenavigator based manipulator

For comfortable movements in the scene, a 3D mouse is recommended. This manipulator works with the Spacenavigator by 3Dconnexion. You can move and rotate along all axis simultaneously.

Spacenavigator based Nodetrackermanipulator

This Manipulator works also with the Spacenavigator by 3Dconnection, but it hast to be attached on a node to track it. The point of view relative to this tracked node is controlled by the Spacenavigator. This manipulator can be used with or without auto homing of the camera:

  • Auto homing camera position: Always returns to the standart viewpoint if the spacemouse is released. Spacemouse represents camera position.
  • Static camera position: The spacemouse input is added to camera position. The camera remains on the last position if the spacemouse is released.

Camera attached to object

Another approach of camera control is the attachment to objects in the scene. Every object has a free configurable camera offset to specify offsets between object's and camera's position/attitude. This way the view out of an objects window (like the cockpit in a car or aircraft) can be represented. To move the camera view, the object hast to be repositioned, usually by connection the object to the externalLink.

While the view out of the cockpit is the same like in other camera control methods, this way directly moves the objects to the right place, wich make's it easy to add a 3rd person viewer, collision detection etc. to the scene.

The approach to control camera by attaching to node and moving node is recommend

For simulators, this approach should be used. Adding 3rd person viewers in the scene can simply be realized via adding render machines the simulation network (also connected via externalLink)

Another method to control camera is to control it via the external link. This way the camera could be placed automatically (by the simulator) without sideeffects in the scene, but without corresponding object movement.