A 3D card display system built with pure Three.js. Four layout modes -- Grid, Sphere, Helix, and Table -- with Matrix rain, drag-and-drop images, and billboarding. No frameworks. No build tools. 793 KB of WebGL.
3dMatrixCards is a WebGL showcase that arranges image cards in 3D space. Users drag and drop their own images, then browse them in four spatial layouts. Cards billboard toward the camera, Matrix digital rain falls in the background, and the whole thing runs in a single HTML file with no build step. This was the first Three.js project -- proof that the browser could handle real 3D.
Three.js loaded via CDN. Everything else is inline HTML, CSS, and JavaScript. The entire app is one file.
Four distinct 3D arrangements with smooth TWEEN transitions between them.
The sphere layout calculation -- distributing cards evenly across a sphere surface using spherical coordinates.
function createSphereLayout(cards, radius) { const positions = []; const count = cards.length; for (let i = 0; i < count; i++) { // Fibonacci sphere distribution const phi = Math.acos(1 - 2 * (i + 0.5) / count); const theta = Math.PI * (1 + Math.sqrt(5)) * i; const x = radius * Math.sin(phi) * Math.cos(theta); const y = radius * Math.sin(phi) * Math.sin(theta); const z = radius * Math.cos(phi); positions.push(new THREE.Vector3(x, y, z)); } // Animate cards to new positions cards.forEach((card, i) => { new TWEEN.Tween(card.position) .to(positions[i], 1200) .easing(TWEEN.Easing.Exponential.InOut) .start(); }); }
Everyone says you need Webpack or Vite for Three.js. You do not. A CDN script tag, an inline module, and you have a full 3D scene. The browser is the runtime. The file is the app. 793 KB, zero dependencies beyond the CDN.
Fibonacci sphere distribution, spherical coordinates, quaternion rotations. The Godot engine hid this math behind nodes. Three.js puts it in your face. And understanding it makes everything else easier.
Without TWEEN animations between layouts, the app would just "jump" between arrangements. The smooth 1.2-second eased transitions are what make it feel alive. Motion is information.
The browser's GPU is waiting to be used. Three.js abstracts WebGL enough to be productive, but the underlying power is immense. This project opened the door to shaders, FXBackgrounds, and everything GPU-accelerated that came after.