wiki:CameraControl

Camera Control

Introduction

osgVisual provides several approaches to control the camera (orientation 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 mechanisms are implemented as camera manipulators. This way it is easy to switch between them during runtime.

The camera can be controlled via:

  1. All standart OSG manipulators like flight, terrain, spherical, nodetracker
  2. A Spacenavigator (http://www.3dconnexion.com) based manipulator
  3. A Spacenavigator based nodetracker manipulator.
  4. Attaching camera to an object and positioning it the scene
  5. External Link

Standard OSG manipulators

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

Spacenavigator based free 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 nodetracker manipulator

This Manipulator works also with the Spacenavigator by 3DConnexion, but it has to be attached to 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. Spacemouse represents camera movements.

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 connecting 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 vehicle 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.

Last modified 14 years ago Last modified on Apr 18, 2010, 11:25:31 AM