Type something to search...

Interactive 3D Surface Plot

  • 3D , Math
  • 01 Feb, 2025

This post embeds a live 3D surface plot rendered with Three.js. The surface is the classic saddle function z = x² − y², color-mapped by altitude.

Controls

  • Left-click + drag — rotate
  • Scroll / pinch — zoom
  • Right-click + drag — pan

How It Works

The surface is generated by sampling the function z = x² − y² over a uniform grid of points. Each vertex is colored according to its z-value using a gradient from blue (low) to red (high).

const z = x * x - y * y;
const color = heightToColor(z, minZ, maxZ);

The mesh uses BufferGeometry with interleaved position and color attributes, and a MeshPhongMaterial with vertexColors: true for the altitude shading.

Three.js OrbitControls handle the mouse/touch interaction. The renderer is hooked to a ResizeObserver so the canvas always fills its container.

Tags:
  • Three.js
  • Webgl
  • Visualization
Share :

Related Posts

Electromagnetic Field Visualization

Electromagnetic Field Visualization

  • Physics , 3D
  • 01 Mar, 2025

An interactive dipole radiation field visualized with Three.js arrow helpers — toggle between E-field and H-field views.

Read more
Three modes, one resonator: an interactive DRA explorer

Three modes, one resonator: an interactive DRA explorer

  • Engineering , Physics
  • 12 May, 2026

An interactive tool for building intuition about dielectric resonator antennas — modes, coupling, and the size–bandwidth tradeoff, all live in your browser.

Read more
Why Wi-Fi won't power your sensors

Why Wi-Fi won't power your sensors

  • Engineering , Physics
  • 11 May, 2026

An interactive Friis transmission calculator showing why ambient RF energy harvesting almost never works — play with the sliders, watch the budget collapse.

Read more
Watching a microwave reflect off a step — in your browser

Watching a microwave reflect off a step — in your browser

  • Engineering , Physics
  • 12 May, 2026

A guided tour of an interactive 3D FDTD simulator running entirely on the GPU in your browser, with a live field animation, colormap chooser, and 3D landscape view.

Read more
How a Neural Network Learns: Step-by-Step Breakdown from Zero

How a Neural Network Learns: Step-by-Step Breakdown from Zero

  • AI , Education
  • 05 Apr, 2025

A step-by-step breakdown of neural network training with an interactive inspector: weights, gradients, backpropagation, softmax, loss function — everything from zero to 100% accuracy.

Read more