Z.AI: GLM 4.5 vs Mistral Large 2
Compare Z.AI: GLM 4.5 by Zhipu AI against Mistral Large 2 by Mistral AI, context windows of 128K vs 128K, tested across 17 shared challenges. Updated February 2026.
Compare Z.AI: GLM 4.5 by Zhipu AI against Mistral Large 2 by Mistral AI, context windows of 128K vs 128K, tested across 17 shared challenges. Updated February 2026.
17 challenges
Tests an AI's ability to create detailed SVG illustrations of gaming hardware
Tests an AI's humor and creative writing ability
Alright, here’s a 3-minute stand-up routine focused on observational humor and relatable frustrations, zero puns allowed:
(Starts pacing slightly, mock-serious expression)
You know what’s weird? We’ve all become masters of pretending to be busy. Seriously. Walking down the street? Phone out, intense stare. Could be reading an important email… or just aggressively swiping past pictures of someone’s vacation avocado toast. Doesn’t matter. Look busy. It’s our modern armor. Someone asks, "Hey, how’s it going?" You gotta hit ‘em with the classic: "Oh, man, so busy! You know how it is!" Even if your biggest accomplishment today was successfully microwaving pasta without detonating the sauce packet. We’re all lying! It’s a collective performance anxiety! Why can’t we just say, "Honestly? I’m kinda tired and contemplating if I have enough energy to open this bag of chips. It’s a real toss-up right now." Would that be so bad? Refreshing, even!
(Leans in conspiratorially)
And speaking of things we lie about… subscriptions. Oh my god, subscriptions. We are financial hostages to our own laziness! Netflix? "We’re raising prices!" Cool, cool, cool… click "Accept." Because what are you gonna do? Go outside? Talk to people? Please! We’d rather pay an extra $3 a month to avoid human interaction! That’s not a subscription fee, that’s an "Avoiding Awkward Small Talk at the Bus Stop" tax! And don’t get me started on the ones you forget about. That random meditation app you downloaded once during a panic attack in 2018? Yeah, it’s still quietly draining your account every month. You find it six years later like, "Oh hey, ZenMaster Pro! Remember me? The guy who used you for 12 minutes and then went back to stressing about his inbox? Yeah, you owe me like, $200." It’s digital pickpocketing, but we’re too busy pretending to be busy to notice!
(Shifts tone to mock-outrage)
Dating now? It’s a haunted house designed by cowards. Ghosting! The ultimate power move for the emotionally stunted! Poof! Gone! No explanation, just… silent treatment via text. It’s like being rejected by a mime! "Did my message about tacos get lost in the digital ether? Or are you just fundamentally incapable of basic human decency?" And the excuses! "I just got really busy!" Really? Busy for three weeks straight? Were you elected president of a small, forgotten island nation? Did you join a cult with a strict no-phone policy? Just say "Hey, not feeling it!" It’s awkward for five seconds! Ghosting is awkward for weeks while I stare at my phone like a sad puppy wondering if I accidentally sent you a picture of my toe fungus! (Pauses) I didn’t, by the way. Probably.
(Wraps up with warm, relatable tech frustration)
Finally, technology. My parents are… challenged. Bless ‘em. My dad calls me, frantic: "Son! The internet’s broken!" I go over. He’s pointing at the monitor. "See? No picture!" I gently lift the blanket off the tower sitting on the floor. "Dad… you need to actually turn the computer on." He looks at me like I just revealed fire. "Well, how was I supposed to know?!" You’ve had this computer for eight years, Dad! Eight years of turning it on by staring intensely at the screen and willing it to boot up! And my mom? She discovered emojis. God help us. Now every text looks like a ransom note written by a clown. "Just went to the store 🛒🥛🍌💃😂👍🙏✨" What does that even mean? Did you buy milk and bananas while dancing? Are you praying the bananas are ripe? Are the groceries entertaining you?! I need subtitles! I’m living with a hieroglyphic poet!
(Smiles, shrugs)
So yeah. We’re busy liars, paying for things we forget, getting ghosted by mimes, and deciphering emoji novels from our parents. It’s chaos out there. But hey… at least we’ve got each other, right? Mostly through memes. Thanks, guys!
(Exits to applause)
Alright, good evening everybody! How are we all doing tonight? Yeah? Yeah? nobody's gonna say 'bad'? Ok, fair enough.
You know, I was walking down the street the other day, and I saw this sign outside a shop that said, "Wet Paint." I thought, "Well, that's weird. Isn't paint supposed to be wet? When's the last time you saw a bucket of dry paint? That's like saying 'Wet Water' or 'Hot Coffee' – oh, wait, they do say that last one. Never mind.
And what's the deal with self-checkout machines? They always tell you, "Unexpected item in bagging area." Really? It's a bag of chips, not a flamingo doing the tango! And why is it always an "unexpected" item? You know what would be an unexpected item? If I scanned a live bear through there. "Oh, hey, just picking up a loaf of bread, some milk, and THIS GUY!"
You ever notice how people get real testy about their favorite coffee places? "Oh, you go to Starbucks? You monster! You know they burn their beans, right?" Yeah, well, you drink tea, so you're basically a serial killer. And why is decaf even a thing? People who drink decaf are like vegetarians at a steakhouse – sure, you can have a seat, but why are you even here?
And speaking of coffee shops, what's with the sizes? Small, medium, large – that's simple, right? But no, we've got "tall," "grande," "venti"... I stand in line, and I'm like, "Uh, yeah, can I get a... medium-ish? Just whatever comes between 'not enough' and 'that's too much, are you crazy?'"
You know who I feel bad for? Meteorologists. They're the only people who can be wrong 90% of the time and still keep their jobs. "There's a 50% chance of rain tomorrow." Yeah, and there's a 50% chance I'm gonna wear pants tomorrow, but you don't see me on the news talking about it!
Alright, that's my time. You've been a great audience! Remember to tip your waitresses, try the veal, and... nah, I can't even say that with a straight face. Goodnight, everybody!
Recreate an interactive, nostalgic Pokémon battle UI in a single HTML file.
Recreate an interactive, classic Mario level in a single HTML file.
Tests an AI's ability to create interactive web elements
Tests an AI's ability to create a detailed world map in SVG format
Generate a single-page, self-contained HTML webapp using Tailwind CSS for a randomly chosen category/industry/niche.
Generate a unique and simple recipe with common ingredients.
Create a starter plan for improving long-term health.
Develop a cutting-edge 3-month longevity plan for a biohacker.
Designed to enhance longevity, physical performance, cognitive function, and stress resilience through cutting-edge, science-backed strategies. Always consult a physician before starting.
Goal: Establish metabolic flexibility, reduce inflammation, and build baselines.
Dietary Protocol
Supplement Stack
Dosages & Cycling
| Supplement | Dosage | Timing | Cycling |
|---|---|---|---|
| NAD+ Precursors | NMN: 500mg | AM on empty stomach | 5 days on, 2 days off |
| Mitochondrial Support | CoQ10: 200mg | With lunch | Daily |
| Anti-Inflammatory | Curcumin (with piperine): 500mg | AM/PM | Daily |
| Gut Health | Probiotics (50B CFU): 1 caps | PM | Daily |
| Blood Sugar | Berberine: 500mg | With meals | 3 weeks on, 1 week off |
| Omega-3 | Algae oil (EPA/DHA): 2g | AM | Daily |
Exercise Routine
Stress Resilience
Wearable Tracking
Goal: Enhance mitochondrial density, cognitive sharpness, and VO2 max.
Dietary Protocol
Supplement Stack
Additions to Month 1
| Supplement | Dosage | Timing | Cycling |
|---|---|---|---|
| Nootropics | Bacopa Monnieri (300mg) | AM | 5 days on, 2 days off |
| Neuroprotection | Lion’s Mane (500mg) | AM/PM | Daily |
| Blood Flow | Citrulline: 1g | Pre-workout | Workout days only |
| Senolytics | Fisetin: 100mg | PM | 3 consecutive days/month |
Exercise Routine
Stress Resilience
Wearable Tracking
Goal: Solidify gains, enhance cellular repair, and stress resilience.
Dietary Protocol
Supplement Stack
Additions to Previous Months
| Supplement | Dosage | Timing | Cycling |
|---|---|---|---|
| DNA Repair | NR (Nicotinamide Riboside): 250mg | AM | 8 weeks on, 4 weeks off |
| Longevity | Spermidine: 1mg | PM | Daily |
| Cognitive | Microdosed Psilocybin* (0.1g) | 1x/week | Legal jurisdictions only |
| Hormonal | DHEA: 25mg | AM | Bloodwork-guided |
*Use where legal; prioritize safety and sourcing.
Exercise Routine
Stress Resilience
Wearable Tracking
| Week | Diet/Fasting | Key Focus | Supplement Adjustments |
|---|---|---|---|
| 1-4 | CKD + 16:8 IF | Metabolic flexibility | Start core stack |
| 5-8 | TKD + 18:6 IF | HIIT/cognitive peaks | Add nootropics + fisetin |
| 9-12 | FMD + 72-hour fast | Cellular repair | Add NR/spermidine |
This plan integrates the latest in longevity science, leveraging wearables for precision and cycling for sustainability. Track, iterate, and prioritize recovery to unlock peak physical and cognitive performance.
Designed for a high-performance biohacker seeking to maximize lifespan, cognitive function, physical performance, and metabolic resilience.
This plan integrates cutting-edge longevity science, advanced supplementation, precision nutrition, personalized fitness, stress resilience training, and real-time biometric tracking to create a data-driven, adaptive protocol for peak biological optimization.
Goal: Establish baselines, optimize metabolic flexibility, and prime the body for deeper interventions.
1. Comprehensive Blood & Biomarker Panel (Before & After 3 Months)
2. Wearable & Continuous Tracking Setup
3. Cognitive & Physical Baseline Testing
Goal: Enhance metabolic flexibility, mitochondrial efficiency, and autophagy while avoiding nutrient deficiencies.
| Day | Protocol | Macros (Approx.) | Key Notes |
|---|---|---|---|
| Mon | Ketogenic (Keto) | 70% fat, 20% protein, 5% net carbs | High-fat, moderate protein, very low carb |
| Tue | Keto + Time-Restricted Eating (TRE) | 16:8 (eat 12-8 PM) | Autophagy activation |
| Wed | Targeted Keto (TKD) | 60% fat, 25% protein, 10% net carbs | Carbs around workout (30-50g dextrose) |
| Thu | Keto + 24h Fast | 0 calories (water, electrolytes, black coffee) | Deep autophagy, stem cell activation |
| Fri | Cyclical Keto (CKD) | 50% fat, 30% protein, 20% net carbs | Refeed to replenish glycogen |
| Sat | Keto + Protein Cycling | 65% fat, 30% protein, 5% net carbs | Lower protein to enhance ketosis |
| Sun | Flexible Keto (FKD) | 60% fat, 25% protein, 10% net carbs | Adjust based on CGM data |
Dosages are personalized—adjust based on bloodwork and wearable data.
| Supplement | Dosage | Timing | Purpose |
|---|---|---|---|
| NMN (Nicotinamide Mononucleotide) | 500-1000mg | AM | NAD+ booster, sirtuin activation |
| Trans-Resveratrol | 250-500mg | AM | SIRT1 activator, anti-inflammatory |
| Fisetin | 500mg | 2x/week (fasting day) | Senolytic (clears zombie cells) |
| Quercetin + Dasatinib (Senolytic Combo) | 500mg Quercetin + 50mg Dasatinib | 1x/month (fasting day) | Deep senolytic effect |
| Magnesium L-Threonate | 2000mg | PM | Cognitive function, synaptic plasticity |
| Omega-3 (EPA/DHA) | 2-3g (1:1 ratio) | With meals | Anti-inflammatory, brain health |
| Vitamin D3 + K2 (MK-7) | 5000-10,000 IU D3 + 200mcg K2 | AM | Bone, immune, cardiovascular health |
| Zinc + Copper | 30mg Zinc + 2mg Copper | PM | Immune, testosterone, redox balance |
| Berberine | 500mg | 3x/day (with meals) | Glucose control, AMPK activation |
| Metformin (if insulin resistant) | 500-1000mg | PM | Longevity, glucose regulation |
| Rapamycin (Sirolimus) (Optional) | 5-10mg | 1x/week (fasting day) | mTOR inhibition, autophagy |
| Collagen Peptides | 10-20g | AM/PM | Skin, joints, gut health |
| Creatine Monohydrate | 5g | Post-workout | Cognitive & physical performance |
| Lion’s Mane + Bacopa Monnieri | 1g + 300mg | AM | Neurogenesis, memory |
| Apigenin | 50mg | PM | Senolytic, anti-inflammatory |
Goal: Maximize muscle retention, mitochondrial density, and cardiovascular health while minimizing injury risk.
| Day | Workout Type | Details | Intensity |
|---|---|---|---|
| Mon | Strength (Upper Body) | 5x5 Heavy Compounds (Bench, OHP, Rows) + Accessories | 75-85% 1RM |
| Tue | HIIT + Sprints | 10x 30s sprint / 90s walk (or bike) | 90%+ max HR |
| Wed | Active Recovery | Yoga, mobility, walking (10K steps) | Low intensity |
| Thu | Strength (Lower Body) | 5x5 Heavy Squats, Deadlifts, Bulgarian Split Squats | 75-85% 1RM |
| Fri | VO2 Max Training | 4x4 min @ 90-95% max HR (2 min rest) | High intensity |
| Sat | Zone 2 Cardio | 60-90 min cycling/walking (60-70% max HR) | Low intensity |
| Sun | Rest or Mobility | Sauna, cold plunge, stretching | Recovery |
Goal: Enhance neuroplasticity, memory, focus, and resilience to neurodegeneration.
| Day | Intervention | Details |
|---|---|---|
| Mon | Dual N-Back Training | 20 min (Brain Workshop / Dual N-Back Pro) |
| Tue | Transcranial PEMF (tPEMF) | 20 min (via NeoRhythm or iTENS) |
| Wed | Neurofeedback (Muse S) | 15 min alpha/theta training |
| Thu | Cold Exposure + Breathwork | 3 min cold shower + 10 min Wim Hof |
| Fri | Non-Sleep Deep Rest (NSDR) | 20 min Yoga Nidra (via Insight Timer) |
| Sat | Psychedelic Microdosing (Optional) | 10-20mcg LSD or 0.1-0.2g psilocybin |
| Sun | Digital Detox | No screens 1 hour before bed, journaling |
Goal: Lower chronic stress, improve HRV, and enhance parasympathetic tone.
| Time | Intervention | Details |
|---|---|---|
| AM | Morning Sunlight | 10-15 min sunlight (no glasses) |
| AM | Cold Plunge | 2-3 min at 50°F (10°C) |
| PM | Sauna (Infrared or Dry) | 20-30 min at 160-180°F (70-80°C) |
| PM | HRV Biofeedback | 10 min (via Elite HRV or HeartMath) |
| PM | Red Light Therapy | 10-15 min (660nm/850nm) |
| Night | Sleep Optimization | 7-9h, 65°F (18°C), blackout curtains, no EMFs |
Goal: Refine protocols based on biometric feedback, deepen autophagy, and enhance performance.
Goal: Lock in gains, optimize biomarkers, and transition to a sustainable long-term protocol.
✅ Metabolic Health:
✅ Longevity Biomarkers:
✅ Physical Performance:
✅ Cognitive Function:
✅ Stress & Recovery:
This plan is aggressive but sustainable—designed for a highly motivated biohacker who wants to push the limits of human performance and lifespan extension.
Ready to begin? 🚀 Let’s optimize.
Design an innovative, multi-component dish worthy of a 3-star Michelin restaurant.
Conceptual Narrative:
This dish embodies the harmony between ocean and earth, celebrating the rare luxury of abalone (ocean’s opulence) and black truffle (forest’s gold). The narrative explores transformation—abalone’s journey from rugged shell to silky tenderness, and truffle’s raw earthiness into ethereal foam. Plating evokes a tidal shore: abalone rests on "sandy" truffle-soil, consommé mirrors seawater, and crisp elements mimic coastal rocks. The pairing defies convention—abalone’s sweet brininess meets truffle’s musky depth, creating a umami crescendo.
Technique: Precision sous-vide + butter emulsification
Ingredients:
Instructions:
Technique: Clarification via raft method
Ingredients:
Instructions:
Technique: Siphon foam for airy texture
Ingredients:
Instructions:
Technique: Layered frying for architectural crunch
Ingredients:
Instructions:
Technique: Dehydrated powder for textural contrast
Ingredients:
Instructions:
Presentation: A slate plate mimicking a beach at twilight.
This dish transforms luxury ingredients into a multisensory journey, worthy of three stars through innovation, artistry, and depth.
Michelin 3-Star Dish: "Ocean’s Whisper & Forest’s Breath"
Conceptual Narrative: This dish is a poetic dialogue between two seemingly disparate ecosystems—the ocean’s depths and the forest floor—united through texture, temperature, and memory. The "Ocean’s Whisper" represents the briny, umami-rich essence of the sea, embodied in a smoked eel and kelp consommé with fermented sea urchin custard, while the "Forest’s Breath" evokes the earthy, aromatic soul of the woods through charred wild mushroom tea, black garlic soil, and pine-infused honeycomb. The dish is a meditation on transience: the eel’s journey from river to sea mirrors the fleeting nature of flavor, while the mushrooms’ mycelial network symbolizes hidden connections beneath the surface.
The plating is a living diorama—a miniature landscape where edible "rocks" (compressed rye bread) cradle "tide pools" of consommé, and "moss" (microgreens and edible flowers) sprouts from a "forest floor" of black garlic soil. The diner is invited to interact with the dish, using a smoked cedar spoon to stir the consommé and release its aroma, or breaking the honeycomb to drizzle its nectar like morning dew.
Unusual Pairing: Cold-smoked eel + fermented sea urchin (uni) + dulse seaweed Techniques: Cold smoking, sous-vide fermentation, consommé clarification, spherification (reverse)
For the Consommé:
For the Fermented Sea Urchin Custard:
Garnish:
Cold-Smoke the Eel:
Ferment the Sea Urchin:
Clarify the Consommé:
Assembly:
Unusual Pairing: Charred matsutake mushrooms + black garlic + pine resin honey Techniques: Dehydration, freeze-drying, fat-washing, honeycomb crystallization
For the Mushroom Tea:
For the Black Garlic Soil:
For the Pine Honeycomb:
Char the Mushrooms:
Infuse the Tea:
Make the Black Garlic Soil:
Crystallize the Pine Honeycomb:
Assembly:
Techniques: Compression, dehydration, aroma diffusion
Shape the "Rocks":
Prepare the Spoon:
Aroma Diffusion:
First Bite (Ocean’s Whisper):
Second Act (Forest’s Breath):
Finale (Landscape Interaction):
| Ingredient | Source | Substitute (if unavailable) |
|---|---|---|
| Matsutake mushrooms | Foraged & Found Edibles (US) | Porcini or king oyster mushrooms |
| Fermented sea urchin | Catalina Offshore Products (US) | Fresh uni + 24-hour miso fermentation |
| Black garlic | Amazon or Korean markets | Slow-cooked garlic (60°C for 40 days) |
| Pine resin honey | MeliBio (US) or Greek specialty shops | Regular honey + 1% pine essential oil |
| Dulse seaweed | Maine Coast Sea Vegetables | Nori or wakame |
| Smoked cedar plank | Smoking Wood | Applewood + cedar oil |
Unusual Pairings with Purpose:
Advanced Techniques:
Plating as Art:
Narrative Depth:
Precision & Rarity:
This dish is not just food—it’s a fleeting ecosystem on a plate, where each bite reveals another layer of the ocean’s whisper or the forest’s breath. It challenges the diner to slow down, observe, and savor the invisible threads that connect us to nature.
Would you like a wine pairing suggestion to complete the experience? (Hint: A smoked German Riesling or aged Jura Vin Jaune would be transcendent.)
Create an autonomous drone simulator with custom environment using ThreeJS
Couldn't render this response
This model didn't return a displayable web page for this challenge.
I'll create an autonomous drone simulator with a futuristic neon city environment. The drone will navigate automatically through waypoints while avoiding obstacles, and you can interact with it by clicking to set new destinations.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Autonomous Drone Simulator</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
overflow: hidden;
background: #000;
}
#canvas-container {
position: relative;
width: 100vw;
height: 100vh;
}
.ui-panel {
position: absolute;
background: rgba(0, 0, 0, 0.8);
border: 1px solid #00ffff;
border-radius: 10px;
padding: 20px;
color: #00ffff;
font-size: 14px;
backdrop-filter: blur(10px);
box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}
.status-panel {
top: 20px;
left: 20px;
min-width: 250px;
}
.controls-panel {
top: 20px;
right: 20px;
min-width: 200px;
}
.info-panel {
bottom: 20px;
left: 20px;
max-width: 400px;
}
.status-item {
margin: 10px 0;
display: flex;
justify-content: space-between;
align-items: center;
}
.status-label {
color: #00cccc;
}
.status-value {
font-weight: bold;
color: #00ff88;
}
.control-btn {
background: linear-gradient(135deg, #00ffff, #0088ff);
border: none;
border-radius: 5px;
padding: 10px 20px;
color: #000;
font-weight: bold;
cursor: pointer;
margin: 5px;
transition: all 0.3s ease;
font-size: 14px;
}
.control-btn:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0, 255, 255, 0.5);
}
.control-btn:active {
transform: translateY(0);
}
.control-btn.active {
background: linear-gradient(135deg, #ff00ff, #ff0088);
}
.slider-container {
margin: 15px 0;
}
.slider {
width: 100%;
height: 5px;
border-radius: 5px;
background: #333;
outline: none;
-webkit-appearance: none;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 20px;
height: 20px;
border-radius: 50%;
background: #00ffff;
cursor: pointer;
box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}
.slider::-moz-range-thumb {
width: 20px;
height: 20px;
border-radius: 50%;
background: #00ffff;
cursor: pointer;
box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}
.waypoint-indicator {
position: absolute;
width: 20px;
height: 20px;
background: radial-gradient(circle, #ff00ff, transparent);
border-radius: 50%;
pointer-events: none;
animation: pulse 1s infinite;
}
@keyframes pulse {
0% { transform: scale(1); opacity: 1; }
100% { transform: scale(2); opacity: 0; }
}
.title {
font-size: 24px;
font-weight: bold;
text-align: center;
margin-bottom: 20px;
text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}
.speed-indicator {
width: 100%;
height: 8px;
background: #333;
border-radius: 4px;
overflow: hidden;
margin-top: 5px;
}
.speed-bar {
height: 100%;
background: linear-gradient(90deg, #00ff00, #ffff00, #ff0000);
transition: width 0.3s ease;
border-radius: 4px;
}
</style>
</head>
<body>
<div id="canvas-container">
<div class="ui-panel status-panel">
<div class="title">DRONE STATUS</div>
<div class="status-item">
<span class="status-label">Mode:</span>
<span class="status-value" id="mode">AUTONOMOUS</span>
</div>
<div class="status-item">
<span class="status-label">Altitude:</span>
<span class="status-value" id="altitude">0m</span>
</div>
<div class="status-item">
<span class="status-label">Speed:</span>
<span class="status-value" id="speed">0 m/s</span>
</div>
<div class="speed-indicator">
<div class="speed-bar" id="speed-bar" style="width: 0%"></div>
</div>
<div class="status-item">
<span class="status-label">Waypoint:</span>
<span class="status-value" id="waypoint">1/5</span>
</div>
<div class="status-item">
<span class="status-label">Battery:</span>
<span class="status-value" id="battery">100%</span>
</div>
</div>
<div class="ui-panel controls-panel">
<div class="title">CONTROLS</div>
<button class="control-btn active" id="auto-btn">AUTO MODE</button>
<button class="control-btn" id="manual-btn">MANUALbutton>
<button class="control-btn" id="reset-btn">RESET</button>
<button class="control-btn" id="add-waypoint">ADD WAYPOINT</button>
<div class="slider-container">
<label class="status-label">Speed Multiplier</label>
<input type="range" class="slider" id="speed-slider" min="0.5" max="3" step="0.1" value="1">
<span class="status-value" id="speed-value">1.0x</span>
</div>
<div class="slider-container">
<label class="status-label">Camera Height</label>
<input type="range" class="slider" id="height-slider" min="50" max="200" step="10" value="100">
<span class="status-value" id="height-value">100m</span>
</div>
</div>
<div class="ui-panel info-panel">
<div class="title">INSTRUCTIONS</div>
<p style="color: #00cccc; line-height: 1.5;">
🚁 The drone flies autonomously through waypoints in the neon city.<br>
🖱️ Click anywhere to add a new waypoint.<br>
🎮 Use controls to switch between auto/manual mode.<br>
⚡ Adjust speed and camera height with sliders.<br>
🎯 Watch as the drone avoids obstacles automatically.
</p>
</div>
</div>
<script>
// Scene setup
const scene = new THREE.Scene();
scene.fog = new THREE.Fog(0x000000, 50, 300);
// Camera setup (isometric view)
const camera = new THREE.OrthographicCamera(
window.innerWidth / -50,
window.innerWidth / 50,
window.innerHeight / -50,
window.innerHeight / 50,
1,
500
);
camera.position.set(50, 100, 50);
camera.lookAt(0, 0, 0);
// Renderer setup
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
document.getElementById('canvas-container').appendChild(renderer.domElement);
// Lighting
const ambientLight = new THREE.AmbientLight(0x404040, 0.5);
scene.add(ambientLight);
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
directionalLight.position.set(50, 100, 50);
directionalLight.castShadow = true;
directionalLight.shadow.camera.left = -100;
directionalLight.shadow.camera.right = 100;
directionalLight.shadow.camera.top = 100;
directionalLight.shadow.camera.bottom = -100;
scene.add(directionalLight);
// Ground
const groundGeometry = new THREE.PlaneGeometry(200, 200);
const groundMaterial = new THREE.MeshStandardMaterial({
color: 0x0a0a0a,
roughness: 0.8,
metalness: 0.2
});
const ground = new THREE.Mesh(groundGeometry, groundMaterial);
ground.rotation.x = -Math.PI / 2;
ground.receiveShadow = true;
scene.add(ground);
// Grid helper
const gridHelper = new THREE.GridHelper(200, 40, 0x00ffff, 0x004444);
scene.add(gridHelper);
// Drone class
class Drone {
constructor() {
this.group = new THREE.Group();
// Drone body
const bodyGeometry = new THREE.BoxGeometry(2, 0.5, 2);
const bodyMaterial = new THREE.MeshStandardMaterial({
color: 0x00ffff,
emissive: 0x004444,
emissiveIntensity: 0.5
});
const body = new THREE.Mesh(bodyGeometry, bodyMaterial);
body.castShadow = true;
this.group.add(body);
// Drone arms and rotors
const armGeometry = new THREE.BoxGeometry(3, 0.2, 0.2);
const armMaterial = new THREE.MeshStandardMaterial({ color: 0x333333 });
const rotorGeometry = new THREE.CylinderGeometry(1, 1, 0.1, 8);
const rotorMaterial = new THREE.MeshStandardMaterial({
color: 0x666666,
emissive: 0x00ff00,
emissiveIntensity: 0.3
});
this.rotors = [];
for (let i = 0; i < 4; i++) {
const angle = (Math.PI / 2) * i;
const arm = new THREE.Mesh(armGeometry, armMaterial);
arm.position.x = Math.cos(angle) * 1.5;
arm.position.z = Math.sin(angle) * 1.5;
arm.rotation.y = angle;
this.group.add(arm);
const rotor = new THREE.Mesh(rotorGeometry, rotorMaterial);
rotor.position.x = Math.cos(angle) * 1.5;
rotor.position.z = Math.sin(angle) * 1.5;
rotor.position.y = 0.3;
rotor.rotation.x = Math.PI / 2;
this.group.add(rotor);
this.rotors.push(rotor);
}
// LED lights
const ledGeometry = new THREE.SphereGeometry(0.1, 8, 8);
const ledMaterial = new THREE.MeshBasicMaterial({ color: 0xff0000 });
const led = new THREE.Mesh(ledGeometry, ledMaterial);
led.position.y = -0.3;
this.group.add(led);
this.position = new THREE.Vector3(0, 20, 0);
this.velocity = new THREE.Vector3(0, 0, 0);
this.targetPosition = new THREE.Vector3(0, 20, 0);
this.waypoints = [];
this.currentWaypointIndex = 0;
this.speed = 0.5;
this.battery = 100;
this.mode = 'auto';
this.rotorSpeed = 0;
scene.add(this.group);
}
update(deltaTime) {
// Update rotor rotation
this.rotors.forEach((rotor, index) => {
rotor.rotation.z += this.rotorSpeed * (index % 2 === 0 ? 1 : -1);
});
if (this.mode === 'auto' && this.waypoints.length > 0) {
// Navigate to current waypoint
const target = this.waypoints[this.currentWaypointIndex];
const direction = new THREE.Vector3()
.subVectors(target, this.position)
.normalize();
const distance = this.position.distanceTo(target);
if (distance > 2) {
this.velocity = direction.multiplyScalar(this.speed);
} else {
// Reached waypoint, move to next
this.currentWaypointIndex = (this.currentWaypointIndex + 1) % this.waypoints.length;
this.velocity.multiplyScalar(0.1);
}
}
// Apply velocity with some smoothing
this.position.add(this.velocity);
this.velocity.multiplyScalar(0.95);
// Update battery
this.battery -= deltaTime * 0.5;
if (this.battery < 0) this.battery = 0;
// Update rotor speed based on movement
this.rotorSpeed = this.velocity.length() * 20 + 5;
// Update drone visual position
this.group.position.copy(this.position);
this.group.rotation.y = Math.atan2(this.velocity.x, this.velocity.z);
// Keep drone above ground
if (this.position.y < 5) {
this.position.y = 5;
this.velocity.y = Math.abs(this.velocity.y) * 0.5;
}
}
addWaypoint(position) {
this.waypoints.push(position.clone());
}
setWaypoints(points) {
this.waypoints = points.map(p => p.clone());
this.currentWaypointIndex = 0;
}
reset() {
this.position.set(0, 20, 0);
this.velocity.set(0, 0, 0);
this.battery = 100;
this.currentWaypointIndex = 0;
}
}
// Building creation
function createBuilding(x, z, width, height, depth) {
const geometry = new THREE.BoxGeometry(width, height, depth);
const material = new THREE.MeshStandardMaterial({
color: new THREE.Color().setHSL(Math.random() * 0.1 + 0.5, 0.5, 0.3),
emissive: new THREE.Color().setHSL(Math.random() * 0.1 + 0.5, 0.8, 0.2),
emissiveIntensity: 0.3
});
const building = new THREE.Mesh(geometry, material);
building.position.set(x, height / 2, z);
building.castShadow = true;
building.receiveShadow = true;
// Add windows
const windowGeometry = new THREE.PlaneGeometry(width * 0.8, height * 0.05);
const windowMaterial = new THREE.MeshBasicMaterial({
color: 0x00ffff,
emissive: 0x00ffff,
emissiveIntensity: 0.8
});
for (let i = 0; i < Math.floor(height / 5); i++) {
const window = new THREE.Mesh(windowGeometry, windowMaterial);
window.position.set(0, i * 5 - height / 2 + 2.5, depth / 2 + 0.01);
building.add(window);
}
scene.add(building);
return building;
}
// Create city environment
function createCity() {
const buildings = [];
// Create buildings in a grid pattern
for (let x = -80; x <= 80; x += 20) {
for (let z = -80; z <= 80; z += 20) {
if (Math.random() > 0.3) {
const height = Math.random() * 30 + 10;
const width = Math.random() * 10 + 10;
const depth = Math.random() * 10 + 10;
buildings.push(createBuilding(x, z, width, height, depth));
}
}
}
// Create some neon towers
for (let i = 0; i < 5; i++) {
const angle = (Math.PI * 2 / 5) * i;
const x = Math.cos(angle) * 60