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 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.
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.
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.
```rust use nalgebra::{Point2, RealField, UnitQuaternion, Vector3}; use trackball::Orbit;
/// Trackball camera mode.
pub struct Trackball
implSelf::handle_left_button_press()
.
self.orbit.discard();
}
}
```
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.