Skip to content

Commit

Permalink
Document graph visualisation additions
Browse files Browse the repository at this point in the history
  • Loading branch information
Robadob committed Oct 19, 2024
1 parent 7cb57eb commit 26364be
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
38 changes: 37 additions & 1 deletion src/guide/visualisation/adding-details.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,42 @@ The below image demonstrates how the above interface appears during a visualisat
.. note::

It is not possible to add multiple inputs for the same environment property or environment array property element to the same panel.

Environment Directed Graphs
---------------------------

FLAME GPU visualisations provide basic visualisation support for graphs defined within a model's environment.

When configuring the visualisation, graphs to be rendered can be specified by name. Following this, their vertex properties which correspond to the spatial coordinates and :ref:`desired color<static-colors>` should be specified. The graph will then be rendered with the simulation, and will update whenever it is modified via the host API.

.. tabs::

.. code-tab:: cpp C++

// Configure the visualisation
flamegpu::visualiser::ModelVis m_vis = cudaSimulation.getVisualisation();
// Mark and configure graph "mygraph" for visualisation
flamegpu::visualiser::EnvironmentGraphVis g = visualisation.addGraph("mygraph");
g.setColor(flamegpu::visualiser::Color{"#ff0000"});
g.setXProperty("x");
g.setYProperty("y");
// g.setZProperty("z");
// g.setXYProperty("xy");
// g.setXYZProperty("xyz");

.. code-tab:: py Python

# Configure the visualisation
m_vis = cudaSimulation.getVisualisation();
# Mark and configure graph "mygraph" for visualisation
g = visualisation.addGraph("mygraph")
g.setColor(pyflamegpu.Color("#ff0000"))
g.setXProperty("x")
g.setYProperty("y")
# g.setZProperty("z")
# g.setXYProperty("xy")
# g.setXYZProperty("xyz")


Lines
-----
Expand Down Expand Up @@ -166,4 +201,5 @@ Related Links
* Full API documentation for :class:`ModelVis<flamegpu::visualiser::ModelVis>`
* Full API documentation for :class:`PanelVis<flamegpu::visualiser::PanelVis>`
* Full API documentation for :class:`LineVis<flamegpu::visualiser::LineVis>`
* Full API documentation for :class:`StaticModelVis<flamegpu::StaticModelVis>`
* Full API documentation for :class:`StaticModelVis<flamegpu::StaticModelVis>`
* Full API documentation for :class:`ModelVis<flamegpu::visualiser::EnvironmentGraphVis>`
3 changes: 3 additions & 0 deletions src/guide/visualisation/setting-up-vis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ The most important of these settings are presented below:
* - :func:`setInitialCameraTarget()<flamegpu::visualiser::ModelVis::setInitialCameraTarget>`
- ``x``, ``y``, ``z``
- Sets the initial target that the visualisation's 'camera' faces. (Defaults to the origin [0,0,0])
* - :func:`setInitialCameraRoll()<flamegpu::visualiser::ModelVis::setInitialCameraRoll>`
- ``roll``
- Sets the initial roll angle of the camera in radians. (Defaults to 0)
* - :func:`setSimulationSpeed()<flamegpu::visualiser::ModelVis::setSimulationSpeed>`
- ``speed``
- Sets the speed of camera movement, in units travelled per millisecond. (Defaults to 0.05)
Expand Down
4 changes: 3 additions & 1 deletion src/guide/visualisation/visualising-agents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,13 @@ First you should set the base model scale (with :func:`setModelScale()<flamegpu:
# Or, set agent scale multiplier with a single float[3] variable
boid_agt.setScaleXYZVariable("scale_xyz")


Agent Color
-----------
There are a wide range of options for controlling the color of agent models.

.. _static-colors:

Static Colors
^^^^^^^^^^^^^

Expand Down

0 comments on commit 26364be

Please sign in to comment.