I'll create an interactive 3D mushroom lifecycle explorer for you! This will be a single HTML file with Three.js for 3D rendering, featuring multiple mushroom species with realistic lifecycle progression.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3D Mushroom Lifecycle Explorer</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/controls/OrbitControls.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
background: linear-gradient(135deg, #2c3e50, #34495e);
color: white;
overflow: hidden;
}
.container {
display: flex;
height: 100vh;
}
.main-view {
flex: 1;
position: relative;
}
.controls {
position: absolute;
top: 20px;
left: 20px;
z-index: 100;
background: rgba(0, 0, 0, 0.8);
padding: 20px;
border-radius: 10px;
backdrop-filter: blur(10px);
}
.mushroom-selector {
margin-bottom: 20px;
}
.mushroom-selector select {
width: 200px;
padding: 8px;
border-radius: 5px;
border: none;
background: rgba(255, 255, 255, 0.9);
color: #333;
}
.lifecycle-control {
margin-bottom: 15px;
}
.lifecycle-slider {
width: 200px;
margin: 10px 0;
}
.stage-indicator {
font-size: 14px;
color: #ecf0f1;
margin-top: 5px;
}
.info-panel {
width: 350px;
background: rgba(0, 0, 0, 0.9);
padding: 30px;
overflow-y: auto;
backdrop-filter: blur(15px);
}
.info-panel h2 {
color: #e74c3c;
margin-bottom: 15px;
border-bottom: 2px solid #e74c3c;
padding-bottom: 10px;
}
.info-section {
margin-bottom: 20px;
}
.info-section h3 {
color: #f39c12;
margin-bottom: 10px;
}
.info-section p {
line-height: 1.6;
color: #ecf0f1;
}
.spore-counter {
background: rgba(52, 152, 219, 0.3);
padding: 10px;
border-radius: 5px;
margin: 10px 0;
}
.environmental-info {
background: rgba(46, 204, 113, 0.3);
padding: 10px;
border-radius: 5px;
}
#canvas-container {
width: 100%;
height: 100vh;
}
.stage-labels {
display: flex;
justify-content: space-between;
font-size: 10px;
margin-top: 5px;
color: #bdc3c7;
}
</style>
</head>
<body>
<div class="container">
<div class="main-view">
<div class="controls">
<div class="mushroom-selector">
<label>Select Mushroom:</label>
<select id="mushroomType">
<option value="button">Button Mushroom</option>
<option value="shiitake">Shiitake</option>
<option value="oyster">Oyster Mushroom</option>
<option value="flyagaric">Fly Agaric</option>
<option value="chanterelle">Chanterelle</option>
</select>
</div>
<div class="lifecycle-control">
<label>Lifecycle Stage:</label>
<input type="range" id="lifecycleSlider" class="lifecycle-slider"
min="0" max="100" value="100" step="1">
<div class="stage-labels">
<span>Spore</span>
<span>Pin</span>
<span>Button</span>
<span>Mature</span>
</div>
<div class="stage-indicator" id="stageIndicator">Mature Stage</div>
</div>
<div class="spore-counter">
<strong>Spores Released: <span id="sporeCount">0</span></strong>
</div>
</div>
<div id="canvas-container"></div>
</div>
<div class="info-panel" id="infoPanel">
<h2 id="mushroomName">Button Mushroom</h2>
<div class="info-section">
<h3>Scientific Name</h3>
<p id="scientificName">Agaricus bisporus</p>
</div>
<div class="info-section">
<h3>Description</h3>
<p id="description">The button mushroom is one of the most commonly cultivated mushrooms worldwide...</p>
</div>
<div class="info-section">
<h3>Lifecycle</h3>
<p id="lifecycleInfo">Complete lifecycle takes 6-8 weeks from spore to harvest...</p>
</div>
<div class="environmental-info">
<h3>Growing Conditions</h3>
<p id="environmentInfo">Temperature: 55-75°F, Humidity: 80-95%...</p>
</div>
<div class="info-section">
<h3>Current Stage Details</h3>
<p id="stageDetails">This is the mature harvesting stage where the mushroom has reached full size and spore production.</p>
</div>
</div>
</div>
<script>
// Mushroom data
const mushroomData = {
button: {
name: "Button Mushroom",
scientific: "Agaricus bisporus",
description: "The button mushroom is one of the most commonly cultivated mushrooms worldwide. Also known as white mushroom, it's the same species as cremini and portobello mushrooms, just harvested at different stages of maturity.",
lifecycle: "Complete lifecycle takes 6-8 weeks from spore to harvest. Spores germinate into mycelium, which forms primordia that develop into pins, then buttons, and finally mature mushrooms.",
environment: "Temperature: 55-75°F, Humidity: 80-95%, grows on composted organic matter",
color: { cap: 0xf5f5dc, stem: 0xffffff, gills: 0xd2b48c },
capShape: "dome",
maxSize: { cap: 1.2, stem: 1.5 }
},
shiitake: {
name: "Shiitake",
scientific: "Lentinula edodes",
description: "Native to East Asia, shiitake mushrooms are prized for their rich, smoky flavor and medicinal properties. They're one of the most popular mushrooms for cultivation and consumption worldwide.",
lifecycle: "Takes 6-14 weeks to mature. Known for their unique ability to fruit on hardwood logs. The mushroom develops distinctive brown caps with white gills.",
environment: "Temperature: 45-75°F, Humidity: 85-95%, grows on hardwood substrates like oak and maple",
color: { cap: 0x8b4513, stem: 0xf5deb3, gills: 0xfffaf0 },
capShape: "flat",
maxSize: { cap: 1.5, stem: 1.2 }
},
oyster: {
name: "Oyster Mushroom",
scientific: "Pleurotus ostreatus",
description: "Oyster mushrooms get their name from their oyster-like appearance and subtle seafood flavor. They're fast-growing and can be found growing on dead or dying hardwood trees.",
lifecycle: "Rapid growth cycle of 7-14 days from pin formation. Known for their fan-like shape and ability to grow in overlapping clusters.",
environment: "Temperature: 45-75°F, Humidity: 85-95%, very adaptable to various substrates",
color: { cap: 0xf5f5f5, stem: 0xffffff, gills: 0xf0f8ff },
capShape: "fan",
maxSize: { cap: 2.0, stem: 0.8 }
},
flyagaric: {
name: "Fly Agaric",
scientific: "Amanita muscaria",
description: "The iconic red mushroom with white spots, fly agaric is one of the most recognizable mushrooms in the world. Found in folklore and fairy tales, it's known for its psychoactive properties.",
lifecycle: "Develops from a white egg-like structure called a volva. The distinctive red cap with white patches emerges as the mushroom matures over 7-10 days.",
environment: "Temperature: 50-65°F, forms mycorrhizal relationships with birch and pine trees",
color: { cap: 0xff0000, stem: 0xffffff, gills: 0xffffff, spots: 0xffffff },
capShape: "dome",
maxSize: { cap: 1.8, stem: 1.8 }
},
chanterelle: {
name: "Chanterelle",
scientific: "Cantharellus cibarius",
description: "Golden chanterelles are highly prized edible mushrooms with a distinctive funnel shape and forked gills. They have a fruity, apricot-like aroma and are sought after by foragers.",
lifecycle: "Slow development over 2-3 weeks. Forms mycorrhizal relationships with trees. The distinctive funnel shape develops gradually from a small orange bump.",
environment: "Temperature: 60-70°F, grows in symbiosis with hardwood and coniferous trees",
color: { cap: 0xffd700, stem: 0xffd700, gills: 0xffa500 },
capShape: "funnel",
maxSize: { cap: 1.6, stem: 1.4 }
}
};
// Three.js setup
let scene, camera, renderer, controls;
let currentMushroom = null;
let sporeParticles = [];
let animationId;
function init() {
// Scene setup
scene = new THREE.Scene();
scene.background = new THREE.Color(0x1a1a2e);
// Camera setup
camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.set(0, 2, 5);
// Renderer setup
renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth - 350, window.innerHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
document.getElementById('canvas-container').appendChild(renderer.domElement);
// Controls
controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;
controls.dampingFactor = 0.1;
// Lighting
const ambientLight = new THREE.AmbientLight(0x404040, 0.6);
scene.add(ambientLight);
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
directionalLight.position.set(5, 10, 5);
directionalLight.castShadow = true;
scene.add(directionalLight);
const spotLight = new THREE.SpotLight(0xffffff, 0.5);
spotLight.position.set(-5, 8, 3);
scene.add(spotLight);
// Ground
const groundGeometry = new THREE.PlaneGeometry(20, 20);
const groundMaterial = new THREE.MeshLambertMaterial({
color: 0x3d2914,
transparent: true,
opacity: 0.8
});
const ground = new THREE.Mesh(groundGeometry, groundMaterial);
ground.rotation.x = -Math.PI / 2;
ground.receiveShadow = true;
scene.add(ground);
// Create initial mushroom
createMushroom('button', 100);
updateInfo('button', 100);
// Event listeners
document.getElementById('mushroomType').addEventListener('change', onMushroomChange);
document.getElementById('lifecycleSlider').addEventListener('input', onLifecycleChange);
// Start animation loop
animate();
}
function createMushroom(type, stage) {
// Remove existing mushroom
if (currentMushroom) {
scene.remove(currentMushroom);
}
const data = mushroomData[type];
const progress = stage / 100;
currentMushroom = new THREE.Group();
// Scale factors based on lifecycle stage
let capScale = Math.max(0.1, progress);
let stemScale = Math.max(0.1, progress * 0.8 + 0.2);
let alpha = Math.min(1, progress * 2);
if (progress < 0.1) {
// Spore stage - tiny particle
createSporeStage(currentMushroom, data);
} else if (progress < 0.3) {
// Primordium stage
createPrimordiumStage(currentMushroom, data, progress);
} else {
// Pin to mature stages
createMatureStage(currentMushroom, data, capScale, stemScale, alpha, type);
}
// Add spore particles for mature stage
if (progress > 0.8) {
createSporeParticles(currentMushroom, progress);
}
scene.add(currentMushroom);
}
function createSporeStage(group, data) {
const sporeGeometry = new THREE.SphereGeometry(0.05, 8, 8);
const sporeMaterial = new THREE.MeshPhongMaterial({
color: 0xffffff,
transparent: true,
opacity: 0.8
});
const spore = new THREE.Mesh(sporeGeometry, sporeMaterial);
spore.position.y = 0.05;
group.add(spore);
}
function createPrimordiumStage(group, data, progress) {
const primordiumGeometry = new THREE.SphereGeometry(0.1 * progress * 3, 8, 8);
const primordiumMaterial = new THREE.MeshPhongMaterial({
color: data.color.stem,
transparent: true,
opacity: 0.6 + progress * 0.4
});
const primordium = new THREE.Mesh(primordiumGeometry, primordiumMaterial);
primordium.position.y = 0.1 * progress;
group.add(primordium);
}
function createMatureStage(group, data, capScale, stemScale, alpha, type) {
// Stem
const stemGeometry = new THREE.CylinderGeometry(0.1, 0.15, data.maxSize.stem * stemScale, 12);
const stemMaterial = new THREE.MeshPhongMaterial({
color: data.color.stem,
transparent: true,
opacity: alpha
});
const stem = new THREE.Mesh(stemGeometry, stemMaterial);
stem.position.y = (data.maxSize.stem * stemScale) / 2;
stem.castShadow = true;
group.add(stem);
// Cap
let capGeometry;
if (data.capShape === 'dome') {
capGeometry = new THREE.SphereGeometry(data.maxSize.cap * capScale, 16, 16, 0, Math.PI * 2, 0, Math.PI / 2);
} else if (data.capShape === 'flat') {
capGeometry = new THREE.CylinderGeometry(data.maxSize.cap * capScale, data.maxSize.cap * capScale * 0.8, 0.2, 16);
} else if (data.capShape === 'fan') {
capGeometry = new THREE.SphereGeometry(data.maxSize.cap * capScale, 16, 16);
capGeometry.scale(1, 0.3, 0.8);
} else if (data.capShape === 'funnel') {
capGeometry = new THREE.ConeGeometry(data.maxSize.cap * capScale, 0.5, 16, 1, true);
}
const capMaterial = new THREE.MeshPhongMaterial({
color: data.color.cap,
transparent: true,
opacity: alpha
});
const cap = new THREE.Mesh(capGeometry, capMaterial);
cap.position.y = data.maxSize.stem * stemScale + 0.1;
cap.castShadow = true;
group.add(cap);
// Gills (simplified)
if (data.capShape !== 'funnel') {
const gillsGeometry = new THREE.CylinderGeometry(data.maxSize.cap * capScale * 0.9, data.maxSize.cap * capScale * 0.9, 0.05, 16);
const gillsMaterial = new THREE.MeshPhongMaterial({
color: data.color.gills,
transparent: true,
opacity: alpha * 0.8
});
const gills = new THREE.Mesh(gillsGeometry, gillsMaterial);
gills.position.y = data.maxSize.stem * stemScale + 0.05;
group.add(gills);
}
// Special features for fly agaric (spots)
if (type === 'flyagaric' && capScale > 0.5) {
for (let i = 0; i < 8; i++) {
const spotGeometry = new THREE.SphereGeometry(0.05, 8, 8);
const spotMaterial = new THREE.MeshPhongMaterial({ color: data.color.spots });
const spot = new THREE.Mesh(spotGeometry, spotMaterial);
const angle = (i / 8) * Math.PI * 2;
const radius = data.maxSize.cap * capScale * 0.6;
spot.position.set(
Math.cos(angle) * radius,
data.maxSize.stem * stemScale + 0.2,
Math.sin(angle) * radius
);
group.add(spot);
}
}
}
function createSporeParticles(group, progress) {
const sporeCount = Math.floor((progress - 0.8) * 100);
document.getElementById('sporeCount').textContent = sporeCount;
for (let i = 0; i < Math.min(sporeCount, 20); i++) {
const sporeGeometry = new THREE.SphereGeometry(0.01, 4, 4);
const sporeMaterial = new THREE.MeshBasicMaterial({
color: 0xffffff,
transparent: true,
opacity: 0.6
});
const spore = new THREE.Mesh(sporeGeometry, sporeMaterial);
spore.position.set(
(Math.random() - 0.5) * 3,
1 + Math.random() * 2,
(Math.random() - 0.5) * 3
);
spore.velocity = new THREE.Vector3(
(Math.random() - 0.5) * 0.02,
-Math.random() * 0.01,
(Math.random() - 0.5) * 0.02
);
group.add(spore);
sporeParticles.push(spore);
}
}
function updateInfo(type, stage) {
const data = mushroomData[type];
const progress = stage / 100;
document.getElementById('mushroomName').textContent = data.name;
document.getElementById('scientificName').textContent = data.scientific;
document.getElementById('description').textContent = data.description;
document.getElementById('lifecycleInfo').textContent = data.lifecycle;
document.getElementById('environmentInfo').textContent = data.environment;
// Update stage indicator
let stageName, stageDetails;
if (progress < 0.1) {
stageName = "Spore Stage";
stageDetails = "Microscopic reproductive cells capable of developing into new organisms. At this stage, the spore is dormant and waiting for the right conditions to germinate.";
} else if (progress < 0.3) {
stageName = "Primordium Stage";
stageDetails = "The spore has germinated and mycelium has formed. Small pin-like structures are beginning to emerge from the substrate.";
} else if (progress < 0.6) {
stageName = "Pin Stage";
stageDetails = "Young mushroom pins are visible and rapidly expanding. The basic mushroom structure is forming with cap and stem differentiation.";
} else if (progress < 0.8) {
stageName = "Button Stage";
stageDetails = "The mushroom has developed its characteristic shape but hasn't reached full size. Growth is accelerating rapidly.";
} else {
stageName = "Mature Stage";
stageDetails = "The mushroom has reached full size and is actively releasing spores for reproduction. This is typically the harvest stage for edible varieties.";
}
document.getElementById('stageIndicator').textContent = stageName;
document.getElementById('stageDetails').textContent = stageDetails;
}
function onMushroomChange(event) {
const type = event.target.value;
const stage = document.getElementById('lifecycleSlider').value;
createMushroom(type, stage);
updateInfo(type, stage);
}
function onLifecycleChange(event) {
const stage = event.target.value;
const type = document.getElementById('mushroomType').value;
createMushroom(type, stage);
updateInfo(type, stage);
}
function animate() {
animationId = requestAnimationFrame(animate);
// Animate spore particles
sporeParticles.forEach((spore, index) => {
if (spore.parent) {
spore.position.add(spore.velocity);
spore.material.opacity -= 0.005;
if (spore.material.opacity <= 0 || spore.position.y < 0) {
spore.parent.remove(spore);
sporeParticles.splice(index, 1);
}
}
});
// Gentle mushroom rotation for better viewing
if (currentMushroom) {
currentMushroom.rotation.y += 0.005;
}
controls.update();
renderer.render(scene, camera);
}
// Handle window resize
window.addEventListener('resize', () => {
camera.aspect = (window.innerWidth - 350) / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth - 350, window.innerHeight);
});
// Initialize the application
init();
</script>
</body>
</html>
This creates a fully interactive 3D mushroom lifecycle explorer with the following features:
🍄 Key Features:
- 5 Different Mushroom Types: Button, Shiitake, Oyster, Fly Agaric, and Chanterelle
- Complete Lifecycle Animation: From spore (tiny particle) through primordium, pin, button, to mature stages
- 3D Visualization: Realistic mushroom models with proper colors, shapes, and features
- Interactive Controls: OrbitControls for 3D navigation, mushroom selector, and lifecycle slider
- Detailed Information Panel: Scientific names, descriptions, growing conditions, and stage-specific details
- Spore Animation: Floating spore particles released during mature stage
- Realistic Lifecycle Progression: Size, opacity, and structural changes based on growth stage
🎨 Visual Elements:
- Beautiful gradient background
- Proper lighting with shadows
- Ground plane for context
- Smooth animations and transitions
- Responsive design
🔬 Educational Content:
- Accurate scientific information
- Detailed lifecycle explanations
- Environmental growing conditions
- Stage-specific development details
The slider smoothly transitions between all lifecycle stages, and each mushroom type has unique characteristics, colors, and special features (like the iconic red cap with white spots on the Fly Agaric). The spore counter increases as mushrooms reach maturity, showing active spore release!