Automatic Flight Paths
OpenSpace includes a system that automatically steers the camera to a target object or position. It reduces the amount of manual navigation needed when moving between objects in the scene.
The system is based on a thesis work by Ingela Rossing and Emma Broman, done in 2020, and has continued to evolve in later OpenSpace releases.
Flying to a Target
The Navigation menu includes a fly-to action for targets in the list. Click one of the icons listed below to start an automatic camera path to that target. The same options are also available in the context menu for focusable nodes in the Scene menu.
Icon |
Name |
Description |
|---|---|---|
|
Fly-to |
Fly to the target using the current default path type, see below |
|
Zoom-to / Frame |
Linear motion to center the target in view |
The path system determines the route based on the current situation and the selected path type (see below). By default, it tries to:
Move the camera smoothly to a useful viewing position, approaching the target from a reasonable direction
Avoid collisions with scene objects when relevant
Prefer a sunlit position if the Sun is part of the scene
Aborting a Path
A camera path can be aborted at any time by clicking the cancel button in the toolbar menu, which appears when a path is playing. This button also shows the current anchor node, which becomes the focus if a path is aborted.
Caveats
The path system has some limitations that are good to be aware of:
Simulation time is paused when a path starts and resumed when it finishes. For best results, pause time manually or use a slow simulation speed before starting a path.
If the distance traveled is very far, or if the camera starts inside the target’s bounding sphere, a linear path is often used instead of the default type. An info message is shown in the log when this happens.
The system assumes that all fly-to targets have a valid bounding sphere. Missing bounding sphere data can lead to unexpected behavior.
Settings
The settings for the gerenated camera paths can be found in the settings menu under . Some useful settings are:
Property |
Description |
|---|---|
The path type that is used when generating a new fly-to path. |
|
Can be used to increase or decrease the traversal speed. |
|
Determines how far from the target the camera should stop. The factor is multiplied by the target’s bounding sphere to compute the final arrival distance. |
|
If enabled, the selected Idle Motion starts when the path finishes. This can be used to begin a rotation around the target automatically. |
|
Tags used to identify nodes that are relevant for path generation and collision handling. Try changing this if the camera is colliding with objects in your scene. |
|
If false, any roll is removed from the rotation interpolation. This is disabled by default as it might introduce fast rotations that are unconfortable for a viewer. You might however want to enable this if you need the camera to have a specific orientation at the end of the path, such as when flying to a navigation state. |
About Path Types
The resulting path depends on the selected path type. The default type, AvoidCollision, avoids nearby objects and rotates the camera as little as possible. It works well when moving between targets that are already centered in view.
If the starting view is not centered on the object being left, ZoomOutOverview can be a better choice. It tries to keep the relevant target in view for as long as possible and gives a better sense of the spatial relation between objects, but it may introduce stronger rotations.
Here is a short description of the different available path type options:
Path type |
Description |
|---|---|
|
Avoids nearby scene graph nodes and follows a mostly direct path to the target. Uses spherical interpolation of rotation and does not actively keep the target centered. Works well when both the start and end views are already valid camera positions. |
|
Moves the camera out to a point where the relevant targets are visible, then approaches the destination. Gives a better overview of the spatial relation between objects. No collision detection is performed. |
|
A straight-line path from the start point to the end point. |
|
A temporary type that avoids collisions while trying to keep the target in view as much as possible. It can produce fast rotations in some situations. |
For now, the desired path type must be chosen using the setting. In the future, the system may choose the path type automatically based on the current situation. The available path types may still change in later releases.
Note
The linear path type is also used as a fallback when the system cannot find a suitable path using the other types. This can happen if the path is very long or if the camera starts inside the target’s bounding sphere. In these cases, a linear path is used to ensure that the camera reaches the target without issues related to risks of numerical instability or other issues.
Scripting
The path system can also be controlled using the scripting API, which also allows for more complex and customized camera movements such as flying to specific positions. The available functions are described in the Camera Paths Using Scripting page.
The Camera Paths are Under Development
The camera path system is still under development, and the available functions and their behavior may change in future releases. If you are interested in the camera path system and plans for its development, feel free to check the currently open issues related to camera paths on GitHub.
Important
The generated camera paths are considered experimental and may not work as expected in all situations. They have primarily been calibrated to create nice flights between different scene graph nodes, and may not work as well for more complex camera scenarios, such as close to planetary surfaces or for flying between certain navigation states.
If you are relying on camera paths for a specific use case, we recommend testing them thoroughly to ensure that they work as expected. In sensitive situations, it may be better to use the session recording system to create a recorded path that is guaranteed to work as expected.
If you encounter any issues, or have ideas for improvement, please report them on Github or contact the OpenSpace team.