Repository navigation
Fix members globe drag and rotate-to-country - #74
Conversation
|
Added: rAF-coalesced rendering (jitter fix), hover pauses auto-rotation, grab/grabbing cursors, low-pass inertia, Hong Kong membership (Ronald Tse) with HK+CN polygon highlight (HK has no Natural Earth 110m polygon — the CN feature carries the Hong Kong interaction). Awaiting manual UX sign-off before merge. |
|
Full drag redo: replaced all hand-mapped frame math with the canonical versor-dragging algorithm (projection.invert → versor.cartesian → multiply(versor.delta(v0,v1), q0), incremental, no clamps). Headless simulation: world point now tracks the cursor on all gestures — right 8px / left 4px / down 6px / rim 14px / diagonal-300px 9px residual (previously perpendicular or zero movement). rAF-coalesced rendering retained for smoothness. Awaiting manual drag test. |
|
ROOT CAUSE FOUND AND FIXED. Your console error ( |
Summary
Fixes the two interaction bugs in the members globe (found by headless simulation against the real projection + world data):
versor.fromAnglesand angles intoversor.delta, which takes sphere cartesians). Now implements the canonical versor-dragging algorithm:projection.invert(pointer)→versor.cartesian→versor.multiply(versor.delta(v0, v1), q0)→versor.rotation, with incremental state updates (1:1 sphere tracking + inertia).versor.interpolateAngles; the actual API isversor.interpolate(quaternion slerp over angles). Rotate-to-country now slerps (great-circle ease, 850ms).Plus smoother motion: auto-rotation eases in over 1.2s after the idle period instead of starting instantly; inertia decay slightly softer.
Verified in Node: simulated 10-step drag rotates 20°→43.6° with finite angles and re-rendered paths; slerp midpoint and endpoint land exactly on the target rotation.
Test plan