{"id":29171962,"url":"https://github.com/ehsanidev/virtual-observatory","last_synced_at":"2025-07-01T13:09:21.047Z","repository":{"id":285721017,"uuid":"945611167","full_name":"ehsanidev/virtual-observatory","owner":"ehsanidev","description":"a simple yet immersive simulation of a night sky using Three.js, a popular JavaScript library for creating and rendering 3D graphics in a browser. This project provides an interactive experience where users can explore a simulated star field, with added interactive elements.","archived":false,"fork":false,"pushed_at":"2025-06-29T23:08:10.000Z","size":1606,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T23:30:15.036Z","etag":null,"topics":["threejs","threejs-learning"],"latest_commit_sha":null,"homepage":"https://ehsanidev.github.io/virtual-observatory/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ehsanidev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-09T20:18:09.000Z","updated_at":"2025-06-29T23:11:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"e13ca0aa-8258-4c68-a5c4-6a8304165541","html_url":"https://github.com/ehsanidev/virtual-observatory","commit_stats":null,"previous_names":["ehsanidev/observatory-animation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ehsanidev/virtual-observatory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsanidev%2Fvirtual-observatory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsanidev%2Fvirtual-observatory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsanidev%2Fvirtual-observatory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsanidev%2Fvirtual-observatory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ehsanidev","download_url":"https://codeload.github.com/ehsanidev/virtual-observatory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsanidev%2Fvirtual-observatory/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262969877,"owners_count":23392530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["threejs","threejs-learning"],"created_at":"2025-07-01T13:09:20.134Z","updated_at":"2025-07-01T13:09:21.034Z","avatar_url":"https://github.com/ehsanidev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Virtual Observatory - README\n\nWelcome to the **Virtual Observatory** project, a simple yet immersive simulation of a night sky using Three.js, a popular JavaScript library for creating and rendering 3D graphics in a browser. This project provides an interactive experience where users can explore a simulated star field, with added interactive elements like surprise messages when clicking on the screen.\n\n## Project Overview\n\nThis project creates a basic 3D environment mimicking an observatory's view of the night sky. Key features include:\n\n- **Star Field**: A vast field of stars randomly positioned to simulate the night sky.\n- **Interactive Elements**: Clicking anywhere on the screen triggers a surprise message.\n- **Dynamic Movement**: The star field rotates slowly to create a sense of movement in space.\n\n## Getting Started\n\nTo run this project, you'll need a modern web browser with JavaScript enabled. Here's how you can set it up:\n\n1. **Clone the Repository**:\n   ```bash\n   git clone [your-repo-url]\n   cd virtual-observatory\n   ```\n\n2. **Open the HTML File**: Navigate to the project directory and open `index.html` in your web browser.\n\n   ```bash\n   open index.html\n   ```\n\n   or simply double-click `index.html` if your file explorer supports this.\n\n## Project Structure\n\n- **index.html**: The main HTML file that loads the JavaScript.\n- **js/script.js**: Contains all the Three.js logic for setting up the scene, camera, renderer, and animations.\n- **css/style.css**: Basic styling for the HTML to ensure full-screen display and text styling.\n\n## Code Explanation\n\n### Scene Setup\n- A scene is created with a black background to simulate the night sky.\n\n### Camera Setup\n- A perspective camera is used with a field of view of 75 degrees, adjusted to the window's aspect ratio.\n\n### Renderer Setup\n- WebGL renderer is used with antialiasing for smoother graphics, sized to fit the browser window.\n\n### Star Field\n- A `BufferGeometry` is used for efficiency, with 10,000 stars positioned randomly within a cube of 2000 units side length.\n- Stars are rendered as points with white color.\n\n### Animation\n- The `animate` function uses `requestAnimationFrame` for smooth animations, rotating the star field slightly each frame to give a sense of motion.\n\n### Event Handling\n- **Resize Event**: Adjusts the camera and renderer when the window size changes.\n- **Click Event**: Adds a fun interactive element where clicking the screen shows a temporary \"You Found Me!\" message at the click position.\n\n## How to Enhance\n\n- **Add More Objects**: Consider adding models like telescopes, observatory domes, or planets.\n- **Improve Interaction**: Enhance user interaction by adding more educational content or interactive star charts.\n- **Customize Stars**: Use different colors or sizes for stars to simulate different star types or add constellations.\n\n## Dependencies\n\nThis project uses:\n- **Three.js** (version 0.150.1) for 3D graphics. The library is loaded directly from a CDN in the script.\n\n## License\n\nThis project is open source and available under the [MIT License](LICENSE). Feel free to use, modify, and distribute as per the license terms.\n\n## Acknowledgements\n\n- Three.js community for providing a powerful and easy-to-use 3D library.\n- The open-source community for inspiration and resources.\n\nEnjoy exploring the virtual cosmos! If you have any questions or suggestions, feel free to open an issue or contribute to the project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehsanidev%2Fvirtual-observatory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fehsanidev%2Fvirtual-observatory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehsanidev%2Fvirtual-observatory/lists"}