The Camera

The camera object allows to control the what you see in the visualization. Those operations are implemented using matrices for projection and transformations.

Used coordinates spaces

Fatum uses three different coordinates spaces :

The camera offers conversion functions to easily switch between those coordinates spaces.

Camera operations

The main camera operation is to move the camera around the scene. You can specify a translation vector in model coordinates using moveModel(vector), or in screen coordinates using moveScreen(vector). You can also zoom in the scene using zoom(scale, center) with scale being the zoom ratio (>1 zooms in, <1 zooms out) and center being the coordinates of the point on which to zoom. Those two operations can be combined to center a specific portion of the visulization using centerBox(box, margin).

The setViewport(viewport) method modifies which portion of the window in rendered to. Viewport is specified in pixels (aka window coordinates).

Double buffered camera

The camera is also double buffered to allow animations. All operations affect the back camera. The camera will animate when fatum.animate() is called. It is also possible to swap the camera states without animation.