Skip to content

Forge-Theory-Labs/solarforge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solar System Asteroid Monitor - Comprehensive README

Solar System Visualization Three.js WebGL

📖 Overview

The Solar System Asteroid Monitor is an interactive 3D visualization of our solar system with real-time planetary tracking, asteroid monitoring, and collision detection capabilities. Built with Three.js and WebGL, this educational tool provides an immersive experience for exploring celestial mechanics and understanding the dynamics of our solar neighborhood.

✨ Features

🌟 Core Visualization

  • 3D Solar System Model: Accurate representation of all 8 planets and the Sun
  • Real-time Orbital Mechanics: Planets follow realistic elliptical orbits with proper inclinations
  • Asteroid Belt: Particle-based representation of the main asteroid belt
  • Named Asteroids: Major asteroids including Ceres, Vesta, Pallas, and Near-Earth Objects
  • Dynamic Scaling: Adjustable planet sizes for better visualization

🎮 Interactive Controls

  • Camera Controls: Zoom, rotate, and tilt for optimal viewing angles
  • Time Manipulation: Control simulation speed from 0.1x to 10x real-time
  • View Presets: Quick access to different solar system regions
  • Object Selection: Click/tap any celestial body for detailed information
  • Search Functionality: Find specific planets or asteroids quickly

🔬 Scientific Features

  • Collision Detection: Real-time proximity warnings for close approaches
  • Gravity Spheres: Visual representation of planetary spheres of influence
  • Orbital Paths: Toggleable orbit visualization with proper eccentricities
  • Hill Sphere Calculations: Scientific computation of gravitational influence zones
  • Accurate Data: Based on real astronomical measurements

📱 User Experience

  • Responsive Design: Optimized for both desktop and mobile devices
  • Touch Controls: Full touch support for mobile users
  • Keyboard Shortcuts: Efficient navigation for power users
  • Loading Optimization: Progressive loading with visual feedback
  • Performance Tuning: Adaptive rendering for different device capabilities

🚀 Quick Start

Prerequisites

  • Modern web browser with WebGL support (Chrome, Firefox, Safari, Edge)
  • JavaScript enabled
  • Recommended: Hardware acceleration enabled

Installation

  1. Download the files

    git clone [repository-url]
    cd solar-system-asteroid-monitor
  2. Serve the application

    • Option A: Open index.html directly in your browser

    • Option B: Use a local server for best performance:

      # Using Python
      python -m http.server 8000
      
      # Using Node.js
      npx http-server
      
      # Using PHP
      php -S localhost:8000
  3. Access the application

    • Navigate to http://localhost:8000 in your browser

🎯 Usage Guide

Basic Navigation

  • Zoom: Mouse wheel or pinch gesture
  • Rotate: Click and drag or touch drag
  • Tilt: Use the camera angle slider or two-finger rotate
  • Select Objects: Click/tap on planets or asteroids

View Controls

  • Zoom Level: 5x to 50x magnification
  • Camera Angle: 0° (top-down) to 90° (side view)
  • Time Speed: 0.1x to 10x real-time
  • Planet Scale: 0.5x to 5x size adjustment
  • View Distance: Filter visible objects by distance from Sun

Display Options

  • Show Orbits: Toggle orbital paths
  • Show Labels: Display object names
  • Show Rotation: Enable planetary rotation
  • Asteroid Belt: Toggle asteroid belt visibility
  • Named Asteroids: Show/hide major asteroids
  • Gravity Spheres: Display gravitational influence zones
  • Collision Warnings: Enable proximity alerts

Keyboard Shortcuts

Key Action
Space Play/Pause simulation
Zoom in/out
Change view distance
+ - Increase/decrease time speed
1-4 Quick view presets
ESC Close info panels

Mobile Touch Controls

  • 👆 Single Tap: Select objects
  • 👆 Drag: Rotate view
  • 🤏 Pinch: Zoom in/out
  • ✌️ Two-finger: Rotate camera angle

🔧 Technical Implementation

Architecture

Solar System Monitor
├── Three.js Rendering Engine
├── WebGL Graphics Pipeline
├── Real-time Physics Simulation
├── Interactive UI Layer
└── Data Management System

Core Components

1. Rendering Engine

  • Three.js r128: Modern WebGL wrapper
  • Optimized Meshes: Efficient geometry management
  • Particle Systems: Asteroid belt visualization
  • Dynamic Lighting: Realistic sun illumination

2. Physics Simulation

// Orbital mechanics implementation
function updateOrbitalPosition(body, deltaTime) {
    const orbitalSpeed = (2 * Math.PI) / body.orbitalPeriod;
    body.angle += orbitalSpeed * deltaTime * timeSpeed;
    
    // Apply Keplerian elements
    const x = body.distance * Math.cos(body.angle);
    const z = body.distance * Math.sin(body.angle);
    const y = body.distance * Math.sin(inclination) * Math.sin(body.angle);
}

3. Collision Detection

  • Proximity-based: Distance threshold monitoring
  • Real-time analysis: Continuous collision checking
  • Visual feedback: Color-coded warning system

4. Data Structure

const celestialBody = {
    name: "Earth",
    radius: 6371,           // km
    distance: 1.0,          // AU
    orbitalPeriod: 365.26,  // days
    rotationPeriod: 1.0,    // days
    color: 0x2233FF,        // RGB hex
    inclination: 0.0,       // degrees
    eccentricity: 0.017     // orbital eccentricity
};

Performance Optimizations

1. Level of Detail (LOD)

  • Mobile: 800 asteroid particles
  • Desktop: 2000 asteroid particles
  • Adaptive geometry complexity

2. Frame Rate Management

const maxFPS = 60;
const interval = 1000 / maxFPS;
let then = Date.now();

function animate() {
    const now = Date.now();
    const deltaTime = (now - then) / 1000;
    
    if (now - then < interval) return;
    // Update logic here...
}

3. Memory Management

  • Proper disposal of Three.js geometries
  • Efficient object pooling
  • Garbage collection optimization

📊 Data Sources

Planetary Data

  • NASA Planetary Fact Sheets: Orbital parameters and physical characteristics
  • IAU Standards: Astronomical unit definitions and constants
  • Scientific Literature: Peer-reviewed measurements

Asteroid Information

  • JPL Small-Body Database: Major asteroid characteristics
  • NASA NEO Program: Near-Earth Object data
  • MPC Database: Minor Planet Center records

Scientific Calculations

  • Hill Sphere Radius: R_h = a * (m / (3 * M))^(1/3)
  • Orbital Period: Kepler's Third Law
  • Sphere of Influence: Planetary gravitational dominance

🛠️ Development

File Structure

solar-system-monitor/
├── index.html              # Main application file
├── README.md              # This documentation
├── assets/               # Optional asset directory
│   ├── textures/         # Planetary textures
│   ├── data/            # Extended datasets
│   └── icons/           # Application icons

Browser Compatibility

Browser WebGL Support Performance Notes
Chrome 70+ ✅ Excellent 🚀 High Recommended
Firefox 65+ ✅ Excellent 🚀 High Recommended
Safari 12+ ✅ Good ⚡ Medium iOS compatible
Edge 79+ ✅ Excellent 🚀 High Chromium-based

Dependencies

  • Three.js r128: 3D graphics library (CDN)
  • No additional dependencies: Pure JavaScript implementation

🎨 Customization

Adding New Celestial Bodies

const newPlanet = {
    name: "New Planet",
    radius: 6000,           // km
    distance: 10.0,         // AU from Sun
    orbitalPeriod: 10000,   // days
    rotationPeriod: 1.5,    // days
    color: 0xFF5733,        // RGB color
    inclination: 5.0,       // orbital inclination
    eccentricity: 0.05      // orbital eccentricity
};

Modifying Visual Styles

/* Custom color scheme */
.planet-card {
    border-left: 3px solid #YourColor;
}

.legend-color {
    background-color: #YourColor;
}

Adjusting Simulation Parameters

// In the initialization section
const simulationConfig = {
    baseScale: 0.0001,      // Size scaling factor
    timeMultiplier: 0.01,   // Simulation speed base
    collisionThreshold: 0.15 // AU distance for warnings
};

🔍 Educational Applications

Classroom Use

  • Astronomy Courses: Visualizing orbital mechanics
  • Physics Education: Demonstrating gravitational forces
  • Programming Classes: Example of 3D web development

Research Applications

  • Orbital Dynamics: Testing theoretical models
  • Collision Probability: Studying close approaches
  • System Architecture: Template for scientific visualization

🐛 Troubleshooting

Common Issues

1. Black Screen / No Rendering

  • Cause: WebGL not supported or disabled
  • Solution: Update browser or enable hardware acceleration

2. Poor Performance

  • Cause: High particle count or weak hardware
  • Solution: Reduce asteroid belt particles or disable effects

3. Touch Controls Not Working

  • Cause: Browser touch event restrictions
  • Solution: Ensure proper touch event handling in browser settings

4. Objects Not Loading

  • Cause: CDN or network issues
  • Solution: Check internet connection or use local Three.js copy

Debug Mode

Add ?debug=true to URL for console logging:

// Enable debug logging
if (window.location.search.includes('debug=true')) {
    console.log('Solar System Debug Mode Active');
    // Additional debug information...
}

📈 Performance Metrics

Target Specifications

  • Frame Rate: 60 FPS (desktop), 30 FPS (mobile)
  • Load Time: < 3 seconds
  • Memory Usage: < 500MB
  • CPU Usage: < 15% average

Optimization Checklist

  • Geometry instancing for asteroids
  • Texture compression for planets
  • LOD system implementation
  • Object culling beyond view distance
  • Memory leak prevention

🤝 Contributing

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Implement changes with testing
  4. Submit pull request

Contribution Areas

  • Scientific Accuracy: Improved orbital calculations
  • Visual Enhancements: Better shaders and textures
  • Performance: Optimization and bug fixes
  • Features: New visualization modes

Code Standards

  • ES6+ JavaScript features
  • Three.js best practices
  • Mobile-first responsive design
  • Accessibility compliance

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

Third-Party Assets

  • Three.js: MIT License
  • Planetary Data: Public domain (NASA)
  • Icons: Educational use permitted

🙏 Acknowledgments

  • NASA JPL: For accurate planetary and asteroid data
  • Three.js Team: For the incredible 3D library
  • Astronomy Community: For ongoing research and data
  • Open Source Contributors: For continuous improvement

📞 Support

Documentation

Community

  • GitHub Issues for bug reports
  • Discussion forums for feature requests
  • Educational institutions for collaboration

🌌 Explore the cosmos with confidence!

This tool brings the wonders of our solar system to your fingertips, making complex astronomical concepts accessible and engaging for everyone from students to professional astronomers.

About

Solar system simulation and orbital mechanics engine

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages