Cameras

Cameras are viewable objects, which means that you can look through them and display a view of what they are looking at. You can have as many cameras as needed in your scene, each one of them offering a different view of the scene. Following shows an example of a scene containing several cameras:

[Scene displaying views of three different cameras]


Make sure not to mix-up cameras with vision sensors. Following are the main differences:

  • A camera has no specific resolution (i.e. it adjusts automatically to the view size). A vision sensor has a fixed resolution.
  • A camera's image content is not directly available via the API (but via a callback mechanism), and image processing not directly supported. A vision sensor's image content can be accessed via the API, and image processing filters are available.
  • A camera generally requires less CPU time and operates faster than vision sensors.
  • A camera can display all object types. A vision sensor can only display renderable objects.
  • A camera can be added to the scene with [Menu bar --> Add --> Camera]. However adding a camera in this way will add the object in a default position and orientation. It is a better practice to add cameras by right-clicking on a specific view of a scene and selecting [Popup menu --> Add --> Camera]. This will add the object just in front of the current view. The added camera is automatically selected and you can then look through it with [Popup menu --> View --> Associate view with selected camera]. For this to work you will have to make sure the popup menu is activated on a view. When a view is created but not yet associated with a viewable object, the [Popup menu --> Add --> Camera] command will add a camera and directly associate it with the view (i.e. look through it). A camera can be associated with any number of views.

    Alternatively you can also associate a view with a camera by activating following popup in a view: [Popup menu --> View --> View selector..]. This will allow you to select the desired camera view from a preview window. When a camera is associated with a view, it can be manipulated with the mouse with following toolbar buttons:

    [Camera navigation toolbar buttons: pan, rotate, shift, zoom, fit-to-view and fly]


  • Pan button: allows shifting the camera in a perpendicular plane to the view direction. The clicked point in the scene will shift at the same rate as the mouse movement. If no specific point is clicked (i.e. when the background is clicked), the shift operation will be performed for an invisible point close to the camera.
  • Rotate button: allows rotating the camera about the clicked point in the scene. If no specific point is clicked (i.e. when the background is clicked), the rotate operation will be performed about an invisible point close to the camera.
  • Shift button: allows shifting the camera along the view direction. This has a zoom effect on camera views that are in perspective projection mode, but camera views in orthogonal projection mode might not see any effect (the cameras will however be shifted along their view direction).
  • Camera angle button: allows adjusting the perspective projection angle of a camera view (when in perspective projection mode), or allows adjusting the view size of a camera view (when in orthogonal projection mode).
  • Fit-to-view button: adjusts the camera of the view that has the focus in order to nicely frame all selected objects, or the entire scene if no object is selected.
  • Fly button: allows "flying" through a scene. The mouse x and y movements are translated into yaw and pitch movements. Acceleration and deceleration is achieved with the shift- and ctrl-keys respectively. When the shift and ctrl keys are held down at the same time, the mouse x and y movements then perform a translation along the camera's x and y axes. In addition to this, the cursor keys allow orienting the camera into a different direction than the flight direction (during flight).
  • While the left mouse button allows above operations, the wheel of the mouse allows shifting the camera along the view direction (if the camera view is in perspective projection mode) or allows adjusting the view size of the camera view (if the camera view is in orthogonal projection mode). The right button, when clicked without a mouse movement will activate a popup menu, however, if the right button is kept pressed while moving the mouse, a camera rotation about the clicked point can be achieved.

    When the camera shift button is activated, it is very easy to navigate in the scene to any desired position and orientation using: (1) the left mouse button for shifting perpendicular to the view direction, (2) the mouse wheel for shifting along the view direction, and (3) the right mouse button for rotating about the clicked point:

    [Default camera navigation: (1) pan with left mouse button, (2) shift with mouse wheel, (3) rotate with right mouse button]


    Cameras can automatically track objects (i.e. follow them as they move) by selecting the object to track, then selecting in the appropriate view [Popup menu --> View --> Track selected object]. A tracking camera will keep its position, but automatically adjust its viewing direction in order to always keep the object to track in its view field. This is different from having a camera attached to that object through a parent-child relationship.


    Recommended topics

  • Related API functions
  • Camera dialog
  • Viewable objects
  • Pages and views
  • Vision sensors