Skip to content

Cassini Ovals

The glowing family of Cassini ovals flowing outwards from two foci while one bright curve morphs from two loops through a figure-eight to a single oval. Loops perfectly.

Background, V1 Effects3DSeamless loop, verified241 lines of codev1.0.0

In Science & maths, Light, glass & shine

Next: Bass PulseSurprise me

Cassini Ovals preview
Starting live preview…
00:00:00:00 / 00:00:00:01

Live, running the real source at reduced resolution.

Your current settings go with it. Combine several clips and hand them over together from your sequence.

Effect controls

Presets

1
1
1

Whole rungs of the family that creep outwards per loop.

1

The preview runs the same code your AI receives. These settings travel with the hand-off.

Info

What it is

The curves of Giovanni Cassini, the points whose distances to two fixed foci multiply to a constant. As the constant grows they morph from two separate loops, through the figure-eight lemniscate, to a single peanut and finally a nearly circular oval. A whole family of them glows on a dark field and flows outwards from the foci like ripples while one bright curve breathes through every shape of the family and back. Choose the colours (electric, amber, violet or mono), how far apart the foci are, the lines' thickness, the flow and the grid.

Reuse it in your own idea

  • Maths explainer: Electric, one rung a loop.
  • Warm science title: Amber, wide foci.
  • Still diagram backdrop: Mono, still.

Which part is reusable

src/cassini-ovals.js is the ingredient your AI reuses. demo.js is only the example scene around it, and uses the demo harness only for the demo.

Good to know

  • The picture is a pure 2D contour plot: no depth, no 3D surface.
  • The foci are always on the x axis.

Technical details

Technical details
Implementation
Three.js 0.185.1 (WebGL) · ES module src/cassini-ovals.js
Exports
  • createCassini({ palette?, spread?, lines?, width?, flow?, grid? }) => { scene, camera, setSize(width, height), update(time, loopSeconds), dispose() }
  • createBloomPass(renderer, { width, height, glow?, exposure?, grain? }) => { render(scene, camera, output?), dispose() }
  • PALETTES: { electric, amber, violet, mono }
Dependencies (exact)
  • three@0.185.1 (source) — Renderer, geometry and shader materials.
  • apw-runtime@1.0.0 (demo) — Demo harness.
How it fits a scene

Coordinates: The plane spans about 1.55 half-heights either way; the foci are at ±0.62 · spread on the x axis.

Lighting: Self-lit; the bloom gives the glow.

Timing: update(time, loopSeconds) sets the loop phase; frames render in any order.

Output
1080×1080, 30 fps, 12 s · procedural (computed from the frame number) · seamless loop — The bright curve's constant is b = a(1 + 0.62 sin(2π·phase)), the ladder of levels creeps a whole number of rungs per loop and everything else is static, so the last frame meets the first.
Tested
Rendered 360 frames on 2026-10-06 in Chrome 154.0.8037.97 headless on Linux 7.0.0-38-generic (x64), Node 22.14.0 (WebGL 2 via SwiftShader (software)). Same frame twice from fresh pages: identical. Loop: Frame 0 vs end state (progress 1): mean |Δ| 0.0000, max |Δ| 0 of 255.
Performance
One full-screen pass with a few evaluations of a complex square per pixel and a small bloom. A couple of milliseconds a frame at 1080p on an integrated Intel GPU. Software WebGL renders in under a second a frame.
Export a video yourself
Download the source, then in the folder: npm install npm run render -- cassini-ovals/1.0.0 --out my-video.mp4Needs Node 18+, ffmpeg and Chrome/Chromium. Add --params my-settings.json (from Copy settings) for your own settings.
Version
1.0.0 · sha256:bd9ce5767aef8785…
Files
License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder. License details
Provenance
Adapted from the owner's threejs-sketches/geometry-math/cassini-ovals (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original shader: gradient-normalised contour lines of |z² − a²| on a creeping geometric ladder, a morphing bright oval through the lemniscate and an exact loop.
BinMore like this

Bass Pulse

Background3DSeamless loop8 seconds

String Art

Background3DSeamless loop12 seconds