2024-03-102 min read•By Joshua Richards

Floating in 3D: Building an Interactive R3F Spatial Canvas

Three.jsR3FWebGLCreative Technology

Floating in 3D: Building an Interactive R3F Spatial Canvas

When redesigning my portfolio, I wanted the homepage to reflect what genuinely excites me as a Creative Technologist: the intersection of tactile hardware, organic aesthetics, and contemporary industrial design. Rather than a static flat layout, we built an interactive spatial stage where three foundational passions float in harmony:

  1. Footwear & Sneakers: High-poly, draco-compressed 3D models with dynamic materials and contact shadows.
  2. Houseplants & Botany: Organic curves, cellular textures, and soft lighting that contrast with sharp digital geometry.
  3. ESP32 & Microcontrollers: Real-time IoT hardware with custom PCB solder masks, exposed pin headers, and pulsing status LEDs.

The Challenge with WebGL Layouts

A common flaw in 3D portfolio sites is performance degradation on mobile devices and awkward camera angles when the viewport resizes. We solved this with a combination of:

  • @react-three/drei's <Float> component configured with decoupled rotation and floating intensities.
  • Responsive camera field-of-view calculation based on window aspect ratio.
  • Smooth raycasted hover animations using spring interpolation.
<Float
  speed={2}
  rotationIntensity={1.2}
  floatIntensity={1.5}
  floatingRange={[-0.1, 0.1]}
>
  <SneakerModel scale={1.8} />
</Float>

Spatial Hierarchy and Lighting

Lighting makes or breaks 3D scenes on the web. Instead of heavy HDR environment maps that add unnecessary bandwidth overhead, we used a curated combination of:

  • An atmospheric directional key light casting soft contact shadows.
  • Subtle ambient fill light with cool cyan tints.
  • Accent point lights attached to the ESP32 board simulating active microcontroller telemetry.

The result is a lightweight, responsive experience running at 60 FPS across desktop and mobile browsers.