Skip to main content
100%

Versor Dragging II

✓ Published0🌍 Public
Mmbostock
Last edited Jul 25, 2019
Created on Jan 18, 2017

This example demonstrates interactive rotation of a world map using versor dragging, allowing the map to spin smoothly in any direction. It uses a Mercator projection rendered onto a Canvas element, with land geometry from the World Atlas TopoJSON dataset. The interaction relies on d3.drag and custom versor quaternion math—provided in a separate versor.js file—to compute rotation deltas between mouse positions, avoiding the gimbal-lock issues of simpler Euler-angle approaches. The map is drawn with d3.geoPath using the canvas context.

AI-generated description

Inspired by ivyywang and Jason Davies. See the orthographic version.

gpl-3.0 Licensed

Similar vizzes