StealThis .dev

Interactive 3D Globe

Interactive 3D globe rendered on canvas with dot-matrix sphere, auto-rotation, and drag-to-rotate interaction — no Three.js required.

Open in Lab
css javascript canvas vue svelte
Targets: TS JS HTML React Vue Svelte

Code

Interactive 3D Globe

A stunning canvas-rendered 3D globe made entirely with math — no WebGL or Three.js. Dots are distributed on a sphere surface using the Fibonacci spiral, then projected to 2D with perspective. The globe auto-rotates and can be dragged to rotate manually.

How it works

  1. Points are placed on a sphere using the golden-angle Fibonacci spiral for even distribution
  2. Each frame, points are rotated around the Y and X axes using rotation matrices
  3. A perspective projection maps 3D coordinates to 2D canvas positions
  4. Dots facing away from the camera are dimmed for a realistic depth effect
  5. Mouse/touch drag updates rotation angles for interactive exploration

Customization

  • DOT_COUNT controls point density on the sphere
  • RADIUS sets the globe size
  • AUTO_ROTATE_SPEED adjusts idle rotation speed
  • Dot color and glow can be customized via constants

When to use it

  • Hero sections for global / international products
  • Location or network visualizations
  • Tech-forward landing pages
  • Dashboard backgrounds