Skip to main content
100%

ThreeJS Starter

✓ Published13🌍 Public
CCurran Kelleher
Last edited May 9, 2025
Created on Oct 26, 2024
Forked from HTML Starter

A Three.js scene displays a single blue cube rotating automatically in 3D space. The cube uses a `MeshPhongMaterial` that responds to both ambient and directional lighting, showcasing interactive orbit controls for drag-to-rotate and scroll-to-zoom. The animation runs via `requestAnimationFrame` with WebGL rendering on a canvas element. The code imports Three.js and its `OrbitControls` addon through import maps, with a responsive resize handler updating camera aspect and renderer size.

AI-generated description

ThreeJS Starter

A simple ThreeJS starter template:

  • Uses import maps!
  • Interactive orbit controls (drag to rotate, scroll to zoom)
  • Responsive design
  • Proper lighting with material that responds to light

Limitations:

  • Currently, all the code needs to live in a single source file, since relative imports are not yet supported in the VizHub Runtime
MIT Licensed

Similar vizzes