3D visualisation of trajectories with Unity
Check this repository: 3D visualization of trajectories and geometries of crowd simulation software (Optimized for JuPedSim and 3D Geometries)
Some related history
Someone sent me a link to a nice project called SumoVizUnity:
Unity3D project for visualization of pedestrian simulations.
Although it seems the project is not actively developed1, however it is still very easy to use and has some nice features like:
- coloring pedestrians with respect to density or speed.
- drawing a measurement line to measure (on the fly) the flow.
- drawing an instantaneous Fundamental Diagram (\(\rho, v\)).
- show the trajectories of pedestrians.
- live plots of different statistics e.g. (\(N, t\))-curve or (\(v, t\))-curve.
Here is a nice demo on Vimeo (German speaker but whatever).
Well now, would it not be great to use this fantastic project to visualize simulations created by
SumoVizUnity needs two different file:
- a geometry file (called
- and a trajectory file called
the names are hard coded, but surely can be changed in the code. For the time being let’s just don’t care.
What we need is a parser to convert
JuPedSim’s files in
SumoVisUnity required formats, move the
produced files in the directory where
SumoVisUnity lives and fire it up:
# call the parser python3 scripts/vizUnity_geometry.py jupedsim_geometry.xml jupedsim_trajectory.xml # mv the files to SumoVisUnity directory mv geometry.txt b090_combined.txt ~/SumoVizUnity # run SumoVizUnity ./SumoViz\ Unity.app/Contents/MacOS/SumoViz\ Unity SumoViz\ Unity
That is it.
Control the visualization
I found these keystrokes helpful to control the scene:
escrotate the scene with the mouse
szoom in and out
dmove left and right
ego up and down
Get the script from the