Passage of Time
๐ TLDR: 3D Astronomy Visualization
- ๐ Interactive 3D Simulation: Earth, Moon, and Sun orbital mechanics in real-time
- ๐ Helical Orbits: Visualize complex 3D motion of celestial bodies over time
- ๐ฎ Full Controls: Play/pause, speed adjustment, time scrubbing, reset functionality
- ๐ฅ๏ธ Web-Based: No installation required, runs in any modern browser
- ๐ Educational: Perfect for astronomy enthusiasts and science education
Key Technologies:
- ๐จ Three.js for 3D rendering
- ๐ Interactive orbital mechanics
- ๐ฑ Mobile-responsive design
- โฟ Accessibility features
๐ Passage of Time ๆถๅ ๆต่ฝฌ
This interactive web application visualizes the orbital paths of the Earth and Moon around the Sun in a 3D environment, simulating their helical motion over time. It uses Three.js for 3D rendering.
Inspired by https://archive.org/details/yousciencescienc00bran/page/172/mode/1up
๐ Overview
- โ๏ธ The Sun (yellow) at the center.
- ๐ The Earth (blue) orbiting the Sun in an elliptical path, completing one orbit in 360 days (for simplification purposes).
- ๐ The Moon (gray) orbiting the Earth, completing one orbit in 30 days (for simplification purposes).
- ๐ Gray orbit lines for the Earthโs path, and ๐ Orange orbit lines for the Moon’s path, simulating a helical motion in 3D space.
- ๐๏ธ Users can control the animation with play/pause, reset, time slider, and speed adjustment features.
๐ฏ Features
- ๐ผ๏ธ 3D Visualization: Uses Three.js to render a 3D scene with helical orbits.
- ๐ฎ Interactive Controls: Play/pause, reset, time slider (days), and speed adjustment.
- โจ Starry Background: A simple starry effect to enhance the space theme.
- โฟ Accessibility: Includes ARIA labels and keyboard controls for better usability.
- ๐ฑ Design: Optimized for both desktop and mobile devices.
๐ ๏ธ Installation
To run this project locally, follow these steps:
๐ฅ Clone the Repository
- If you have a GitHub repository for this project, clone it:
git clone <repository-url>
cd passage-of-timeIf not, create a new folder and download the files manually.
๐ Set Up a Local Web Server
Since this project relies on JavaScript and CDNs, you need to serve it via a web server (not directly from file://):
- Using Python (recommended for quick setup):
python -m http.server 8000- Then open your browser and navigate to http://localhost:8000.
- Using VS Code Live Server Extension: Install the Live Server extension, right-click index.html, and select “Open with Live Server.”
Alternative:
- Use any local web server (e.g., Node.js with http-server).
- Ensure Internet Connection
The project uses CDN-hosted Three.js and OrbitControls libraries, so an active internet connection is required for the initial load.
๐ Usage
- Open index.html in a web browser via a local web server.
- Use the controls at the bottom to interact with the animation:
- โถ๏ธ Play/Pause Button: Start or stop the animation (also toggle with the spacebar).
- ๐ Reset Button: Reset the animation to Day 0 (also use the ‘r’ key).
- โฐ Time Slider (Days): Adjust the current day (0โ360) to view specific positions.
- โก Speed Slider: Adjust the animation speed (0.1x to 2x).
- The starry background and celestial bodies (Sun, Earth, Moon) should be visible, with gray orbit lines showing their paths.
- Click “Play” to see the animation of helical orbits.
๐ Prerequisites
- ๐ A modern web browser (e.g., Chrome, Firefox, Edge, versions from 2023 or later) with WebGL enabled.
- ๐ถ An internet connection to load Three.js and OrbitControls from CDNs.
โ ๏ธ Known Issues
- If you see errors like THREE is not defined, ensure your internet connection is active and the CDN URLs in index.html are accessible.
- Consider using local copies of three.min.js and OrbitControls.min.js if CDNs fail (see comments in index.html for fallback instructions).
- Orbit controls may not work if the OrbitControls.min.js script fails to load. Temporarily, the project operates without orbit controls until visibility is confirmed.
๐ค Contributing
- Contributions are welcome!
๐ Acknowledgements
- Built using Three.js for 3D rendering.
- Images from SolarSystemScope
- Inspired by a retro-style image of Earth, Moon, and Sun orbits, from a 1960’s science textbook illustration
๐ Inspiration Videos
YouTube Video - Orbital Mechanics Visualization:
Bilibili Video - Space and Time Visualization:
https://www.bilibili.tv/en/video/4788698128587264?bstar_from=bstar-web.homepage.recommend.all
๐ License
- Distributed under the GNU Affero General Public License v3.0 License. See
LICENSEfor more information.