Skip to main content
Public

Share visualization

Loading preview…

Predator-Prey Dynamics with 3D Fox and Rabbit Models

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Predator-Prey Dynamics with 3D Fox and Rabbit Models

0 stars0Public
CCurran Kelleher
Last edited Nov 15, 2026
Created on Nov 15, 2026
Forked from React D3 Starter

This example shows a React and D3 interactive scatter plot of five clickable circles loaded from a local CSV file. Clicking a circle highlights it by changing its fill to white and adding a black stroke, using React state to track the selected circle’s ID. The visualization rescales circle positions with `d3.scaleLinear` based on container dimensions tracked by a `ResizeObserver` hook. Rendering is handled imperatively through `d3.select`, `selection.join`, and event listeners, while React manages data loading and state updates.

Rabbits & Foxes — 3D Predator–Prey Ecosystem

A live population-dynamics simulation rendered in three.js. Light-green rabbits and orange foxes (built as small 3D models) wander a grassy field and interact. Each animal's territory is drawn as a Voronoi tessellation on the surface. Foxes hunt rabbits, gain energy when they catch one, reproduce when well-fed, and starve when they can't find food. The balance produces classic Lotka–Volterra boom-and-bust cycles, tracked in a live population chart.

Features

  • Agent-based rabbit/fox ecosystem on an interactive 3D field
  • Low-poly 3D rabbit and fox models
  • Voronoi territory tessellation drawn on the surface, tinted by species
  • Rabbits reproduce (bounded by field capacity); foxes hunt, gain energy, reproduce, and starve
  • Live counts and a rolling population sparkline (green = rabbits, orange = foxes)
  • Extinction status readout and a "Restart Ecosystem" button
  • Drag to orbit; scroll to zoom
  • Responsive, full-window canvas

Usage

Open index.html in a browser. The simulation starts automatically — drag to orbit, scroll to zoom, and watch the population chart for predator–prey oscillations. When foxes starve, rabbit numbers explode; when rabbits overbreed, foxes thrive.

References

Comments

Sign in to join the discussion.