TypologySienna Chen
ToolsMiddleweight

Three.js

The standard toolkit for 3D on a web page.

The most common toolkit for putting 3D on a web page. You describe objects, lights and a camera, and it draws them in the browser. Most of the 3D demos on X are built with it, so when you ask for “3D on a website” this is usually what you get.

Breaks when
bundle bloat from importing all of threeCDN import maps break on version bumps
Also called
threejs, THREE, three

Prompts

Product hero, one object
Build a single-page Three.js scene: one glTF (/model.glb) centered, PerspectiveCamera fov 32 at (0, 0.6, 4.5) looking at the origin. Lighting: RoomEnvironment for IBL plus one DirectionalLight at (2, 4, 3), intensity 1.6, casting a 2048 shadow map onto an invisible ShadowMaterial floor (opacity 0.22). ACESFilmic tone mapping, exposure 0.95, sRGB output. The pointer rotates the object ±12° with damping 0.08; no OrbitControls. Idle: a 14 s slow yaw. Handle resize, cap DPR at 2, dispose everything on unmount. Vanilla ES modules via an import map, no bundler.
Editorial background, no asset files
Three.js scene with zero external assets: 240 thin TorusGeometry rings (radius 0.5–3.2, tube 0.006) sharing one MeshBasicMaterial in the ink color at opacity 0.35, placed on a Fibonacci sphere and rotating as one group at 0.02 rad/s. OrthographicCamera so it reads as a diagram, not a product shot. Fog from 6 to 14 units in the page background color so far rings dissolve. Pause the loop when the section is off-screen (IntersectionObserver) and when the tab is hidden.
Scene behind a long article
Mount a fixed full-viewport Three.js canvas behind a normal HTML article with three sections. When a section becomes active (IntersectionObserver, threshold 0.5), tween the camera to that section’s stored position and target over 1.1 s (GSAP power3.inOut) and cross-fade the section’s group opacity. The camera depends only on which section is active, never on raw scroll position, so it is deterministic at any scroll speed. Keep total draw calls under 40 and log renderer.info once.

Related

Resources · 9