xeolabs / xeogl

A WebGL-based 3D engine for technical visualization. Not actively maintained.
http://xeogl.org
Other
1.15k stars 264 forks source link

Example of lookat rotation about arbitrary pivot point #251

Closed xeolabs closed 6 years ago

xeolabs commented 6 years ago

We need an example where:

  1. user clicks to select a point on the surface of an entity
  2. horizontal mouse/touch drag orbits (ie. 'yaws') the (eye, look, up) about that pivot point, orbiting around the World-space vertical axis running through the pivot point. World "up" can be arbitrarily configured in xeogl, but we'll assume +Y for now and generalize that later.
  3. vertical drag orbits (ie. 'pitches') the (eye, look, up) about the pivot, where the axis about which it pivots is the one that runs through the pivot point and is orthogonal to the (pivot)->(world up) and (pivot)->(eye) vectors.

An example of this behaviour can be seen in Solibri (free to use): https://www.solibri.com/products/solibri-model-viewer/

If that deviates from my description, that would be more correct than my description ;)