Skip to main content
Version: 🚧 Alpha 🚧

Displays

GAMA allows modelers to define two kinds of displays in a GUI experiment:

  • 2D displays (type: 2d), rendered with Java2D
  • 3D displays (type: 3d), rendered with OpenGL

Both draw the same objects (agents, charts, texts, shapes), but the 3D display adds what a 3D environment implies (a camera, an elevation, a light) and keeps up better with large simulations.

The 3D displays of this release are rendered by a new engine built on the OpenGL 4.1 Core Profile: rendering is entirely shader-based, which brings higher frame rates, better polygon throughput and lower GPU memory usage. The change is transparent for modelers: no model modification is required, and the older spelling type: opengl keeps resolving to a 3D display, as the engine of previous versions is still shipped beside the new one.

Classical displays (2d)​

The classical displays showing any kind of content can be manipulated with the mouse (as long as the model defines no mouse event of its own):

  • holding the left button and moving the pointer pans the view,
  • the right button opens the contextual menu of the display, which inspects what is under the pointer,
  • the wheel zooms in and out.

A Java2D road map in the simulation view, with the display toolbar along the top right.

Each display provides several buttons to manipulate it (from left to right):

  • Pause or resume the current view: when pressed, the display stops being redrawn while the simulation keeps running,
  • Synchronize: when pressed, the redrawing of the display and the execution of the model are synchronized. Most of the time, this reduces the speed of the simulation.
  • Zoom in,
  • Zoom to fit view,
  • Zoom out,
  • Take a snapshot: saves the current view as a PNG image in the snapshots folder, created next to the model.
  • Toggle antialias: antialiasing produces smoother outputs, but costs speed and memory.
  • Toggle fullscreen: displays the view in fullscreen. ESC leaves that mode.
  • Browse agents: opens the Browser view, which lists the agents the display shows. Only the species that appear in the display can be browsed.

In addition to these commands, the contextual menu of a display provides three more commands, under "Presentation":

  • Toggle overlay (⌘O on macOS): shows or hides a semi-transparent toolbar at the bottom of the display, giving the coordinates of the mouse, the zoom, the number of frames per second of the simulation, and a scale that follows the zoom level.
  • Toggle toolbar (⌘T on macOS): shows or hides the toolbar at the top of the display.
  • Background: changes the background color.

The same menu also offers World and Browse agents.... Depending on the display, it can list entries for visible agents and layers; these entries open their own submenus.

The road display context menu and its Presentation submenu; an arrow marks the right-click location on the map.

When the view is displayed in fullscreen mode, the toolbar moves to the bottom of the view and contains, in addition to the buttons described above, a button that shows or hides the side controls, and the controls of the experiment (run, step, speed, reload, close).

A Java2D road map in fullscreen mode, with the experiment controls at the bottom left and display controls at the bottom right.

3D displays​

The 3D displays offer all the features provided by 2D displays, in a 3D environment:

  • the same behaviour with the left button, the right button and the wheel as in the 2D displays;
  • holding command (on macOS) or Ctrl (on Windows and Linux) with the left button and moving the pointer controls the camera: its location, its target, its orientation.

They provide the features of a 3D environment for visualizing and understanding a simulation.

A 3D display carries the same menus and the same buttons as a classical display, and adds two: the padlock that locks the camera so that it stops following the agents, and the camera menu, which names the cameras of the display, lets one be chosen and copies its definition to the clipboard. An axis triad (X, Y, Z) indicates the orientation of the environment in the corner of the view. The sidebar provides yet more options related to 3D displays.

A terrain and ant agents in a 3D display, with the orientation axes at the upper left and display toolbar at the upper right.

Camera commands​

KeyFunction
Double ClickZoom Fit
+Zoom In
-Zoom Out
UpVertical movement to the top
DownVertical movement to the bottom
LeftHorizontal movement to the left
RightHorizontal movement to the right
CTRL or CMD + UpRotate the model up (decrease the phi angle of the spherical coordinates)
CTRL or CMD + DownRotate the model down (increase the phi angle of the spherical coordinates)
CTRL or CMD + LeftRotate the model left (increase the theta angle of the spherical coordinates)
CTRL or CMD + RightRotate the model right (decrease the theta angle of the spherical coordinates)
SPACEReset the pivot to the center of the envelope
KEYPAD 2,4,6,8Quick rotation (increase/decrease phi/theta by 30°)
CTRL or CMD + LEFT_MOUSEMakes the camera rotate around the model
ALT+LEFT_MOUSEBegins agent selection using an ROI (Region of Interest)
SHIFT+LEFT_MOUSEDraws a sticky ROI on the display, one that is kept from frame to frame
SCROLLZoom in/out on the current target (the center of the sphere)
WHEEL CLICKReset the pivot to the center of the envelope
  • Keystone: the keystone moves the four corner points of the environment bounding box. It can be used to project a simulation onto a physical model, as the projector introduces distortions of its own. Press k to enter keystone mode and drag the corners; press k again once the adjustment is right, which copies the corresponding facet to the clipboard. It can then be pasted in the model as the keystone: facet of the display, so that the geometry is kept from one run to the next.