trackball
Virtual Trackball Orbiting via the Exponential Map
This is an alternative trackball technique using exponential map and parallel transport to preserve distances and angles for inducing coherent and intuitive trackball rotations. For instance, displacements on straight radial lines through the screen's center are carried to arcs of the same length on great circles of the trackball. This is in contrast to state-of-the-art techniques using orthogonal projection which distorts radial distances further away from the screen's center. This implementation strictly follows the recipe given in the paper of Stantchev, G.. “Virtual Trackball Modeling and the Exponential Map.” . S2CID 44199608.
Status
Currently only nalgebra
is supported as underlying linear algebra library but others will be
supported behind feature gates so that only your library of choice becomes a dependency. The
Orbit
operation handler will be complemented with other handlers for common trackball camera
mode operations like slide, scale, and focus. Projection view matrices will be computed as well
with scale preserving transitions between orthographic and perspective projection mode.
Example
A trackball camera mode implementation can be as easily as this by delegating events of your 3D
graphics library of choice to the Orbit
operation handler along with other handlers for
common trackball camera mode operations like slide, scale, and focus.
use ;
use PI;
use Orbit;
/// Trackball camera mode.
C11 Implementation
An identical C11 implementation can be used instead by enabling the cc
feature as in:
[]
= { = "0.1", = ["cc"] }
License
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the works by you shall be licensed as above, without any additional terms or conditions.