Prompt:
Develop an interactive 3D Ocean Simulator using Python with PyOpenGL Pygame and NumPy. No pre-built ocean/physics libraries allowed. Single Python file. ══════════════════════════════════ CORE FEATURES (Required) ══════════════════════════════════ 1. OCEAN SURFACE — GERSTNER WAVES - Superimpose at least 5 Gerstner wave components (varying amplitude, wavelength, direction, speed) - Real-time vertex displacement on a 128x128 grid mesh - Recalculate normals each frame for correct lighting - Foam/whitecap: white patches on wave crests when steepness exceeds threshold - Horizon fog blending distant water into sky color 2. UNDERWATER MODE - Press "U" to toggle above/below water camera - Underwater effects: blue-green depth tint, volumetric god rays from surface, depth fog (visibility decreases with depth) - Caustic light patterns animated on the sea floor - Procedural sea floor terrain (Perlin noise) with sandy texture coloring 3. FISH SCHOOLS (BOID ALGORITHM) - Reynolds boids: separation, alignment, cohesion - 2 fish species with different colors, sizes, and school tightness - 30-50 fish per school - Obstacle avoidance (sea floor, water surface) - Fish body oriented along velocity vector4. CORAL REEF - 3 procedurally generated coral types (branching, dome, fan) with distinct colors - Placed in clusters on the sea floor - Subtle swaying animation based on a simple current vector 5. WEATHER SYSTEM - 3 presets: Calm / Moderate / Storm — switchable with 1, 2, 3 keys - Smooth transition (5 seconds) affecting: wave amplitude, sky darkness, foam density, underwater visibility - Storm adds: rain streaks (falling line particles above water), occasional lightning flash (screen flash brief bright directional light) 6. SHIP ON SURFACE - One sailboat rendered on the ocean - Ship follows wave height at its position (samples Gerstner wave) - Pitch and roll based on local wave slope - V-shaped foam wake trail behind ship - Click on ocean surface to reposition the ship══════════════════════════════════ BONUS FEATURES (If Capable)══════════════════════════════════ B1. SHARK PREDATOR - Shark patrols reef area, chases nearest fish school when close - Fish scatter (break boid formation) when shark is within fear radius - Sinusoidal body swimming animation B2. DAY/NIGHT CYCLE - Time-of-day slider (0-24h) controlling sun position - Sky color shifts (blue → sunset orange → night dark blue) - Underwater: bioluminescent glow on corals at night - Moonlight at night: dim cool-toned lighting B3. SPLIT VIEW - Press "V" for horizontal split: top half above water, bottom half underwater at same location - Both views render simultaneously ══════════════════════════════════ CAMERA & CONTROLS ══════════════════════════════════ - WASD: move, QE: ascend/descend, Mouse drag: look direction - Scroll: movement speed - U: toggle underwater, R: reset camera - 1/2/3: weather presets - Space: pause/resume simulation - S: screenshot (save PNG) ══════════════════════════════════ GUI (Minimal HUD) ══════════════════════════════════ - Bottom bar: FPS, camera depth, current weather state, fish count, wind direction arrow - Top-right: weather indicator icon (sun / cloud / storm)══════════════════════════════════ TECHNICAL REQUIREMENTS══════════════════════════════════ - Window: 1280x720, target 30 FPS - Single Python file, only pygame PyOpenGL numpy standard libs - OOP structure: OceanSurface, BoidSystem, CoralGenerator, WeatherSystem, Ship, Camera, Scene - Docstrings on each class - Launch with Calm weather, one fish school, one sailboat, coral reef visible underwater Write the complete working code.