Skip to content

dylrz/scale-solar-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scale Solar System: A Cosmic Canvas Simulation

Welcome to Scale Solar System, an interactive canvas-based simulation that brings the cosmos right to your browser! This project harnesses the power of HTML5 canvas and JavaScript to create a dynamic visualization of a solar system, complete with twinkling stars, wandering comets, and a detailed representation of our own solar system's planets.

Features

Dynamic Universe: Experience an ever-changing universe with stars that twinkle, comets that streak across the sky, and planets that orbit in scaled real-time.

Interactive Solar System: Click on planets to learn fascinating facts about them. Discover details about their composition, orbits, and more.

Responsive Design: The canvas automatically adjusts to your screen size, ensuring a seamless experience on both desktop and mobile devices.

Physics-Driven Motion: Watch as the gravitational forces between celestial bodies influence their paths through space, all calculated in real-time.

Zoom and Pan: Explore the vastness of space with intuitive zoom and pan controls, allowing you to focus on the details or take in the grandeur of the entire solar system.

Educational Insights: Clicking on planets opens informative modals filled with interesting trivia and facts, making this simulation not just visually appealing but also educational.

How It Works

Canvas Setup: At the heart of this simulation is the HTML5 canvas, where all the magic happens. The canvas is dynamically sized to fit the window, providing a vast stage for the simulation.

Celestial Objects: The script populates the universe with stars, comets, and a detailed solar system. Planets are rendered according to their real-world characteristics, such as size, color, and orbit, albeit scaled for visual clarity.

Physics Simulation: Utilizing simplified physics, each non-stationary object experiences gravitational forces from every other object, influencing its velocity and trajectory.

User Interaction: Through event listeners, the simulation responds to user actions. Resize events trigger a reconfiguration of the canvas dimensions and star generation, while mouse and touch events allow users to interact with the solar system, learning more about each planet.

Animation Loop: A continuous animation loop updates the positions of all objects, redraws their paths, and applies any user-induced transformations like zooming and panning.

Explore and Learn

Scale Solar System is more than just a technical showcase; it's a gateway to the wonders of our universe. Whether you're a student, educator, or just a curious mind, this simulation offers a unique way to visualize the celestial mechanics that govern our solar system and beyond.

Dive into the cosmos with Scale Solar System and let the beauty of the universe inspire you!