[x3d-public] Navigation > googleEarth/cesium > PAN, ZOOM, TURN

GPU Group gpugroup at gmail.com
Mon Jul 13 14:49:47 PDT 2020


In preparation for new geospatial navigation modes, I tried
implementing googleEarth/cesium style PAN, ZOOM and TURN for regular
scenery.

DESCRIPTION:
- all 3 keep the terrain point of interest aka 'pin point' under the
(mouse/pointing device) cursor during navigation action.
PAN - LMB down established pin point, and LMB drags are in a plane
perpendicular to the bound-viewpoint-vertical
ZOOM - WHEEL zooms .8 or 1.25 along ray to pin_point
TURN - like turntable, except turning is around pin_point

RESULTS:
http://dug9.users.sourceforge.net/web3d/tests/PAN_TURN_ZOOM_july13_fw.mp4
http://dug9.users.sourceforge.net/web3d/tests/47_PAN.x3d

METHOD:
on PAN and TURN mouse-down, and on WHEEL action:
- shot a ray from cursor position to scene, and got a 6DOF degree of
freedom ray nearPlane xyz, and intersection xyz
- PAN and TURN - converted ray points into bound-viewpoint space
PAN > on mouse drag:
- converted ray into bound-viewpoint-vertical, intersect ray with
initial plane, got delta xy and added to viewer position
TURN - on mouse drag:
- delta_tilt = f(vertal screen drag) ie .25 * PI for screen height drag
-- applied tilt around axis parallel to viewer X-axis
- delta_yaw - f(horizaontal screen drag) ie .25 * PI for screen width drag
- rotated initial ray by delta_tilt x delta_yaw, added to viewer position
- rotated viewer orientation by delta_tilt x delta_yaw
ZOOM - on wheel notch event
- moved viewer position by .8 x ray length or 1.25 x ray length
depending on direction

https://sourceforge.net/p/freewrl/git/ci/develop/tree/freex3d/src/lib/scenegraph/Viewer.c#l1370
- see handle_pan function



More information about the x3d-public mailing list