โœฆ StealThis .dev

3D Floating Geometric Shapes

Ten distinct Three.js geometric shapes floating in space with sine-wave drift, self-rotation, and a mouse parallax camera effect.

Open in Lab
threejs webgl
Targets: JS HTML

Code

3D Floating Geometric Shapes

Ten distinct Three.js geometries arranged in space, each with its own personality:

  • Sine-wave float: staggered phase and amplitude per shape for natural drift
  • Self-rotation: each shape rotates on a unique random axis
  • Mouse parallax: the camera subtly shifts with cursor movement
  • Mixed materials: alternates between solid MeshStandardMaterial and MeshBasicMaterial wireframes

Shapes included

TorusKnot, Icosahedron, Octahedron (wireframe), Dodecahedron, Tetrahedron (wireframe), Torus, Sphere, Box (wireframe), Cone, Cylinder

Implementation notes

  • mesh.userData stores per-shape float parameters (phase, amplitude, frequency, rotation axis)
  • Camera parallax uses lerp on a targetOffset vector for smooth lag
  • Two colored PointLights create the purple/pink accent lighting