@kajws/galaxy-vr
v1.1.1
Published
A VR web component for galaxy simulation using Three.js and WebXR
Maintainers
Readme
Galaxy-VR
A VR web component for galaxy simulation using Three.js and WebXR, built on top of @kajws/galaxy-js. This component provides an immersive experience for visualizing galaxy dynamics in a virtual reality environment.
Features
- VR Ready: Full WebXR support for immersive VR experiences.
- 3D Galaxy Simulation: Renders multiple galaxies with thousands of stars.
- Interactive Controls: Orbit controls for easy navigation in 3D space.
- Custom Element: Easy to embed in any web page as a
<vr-galaxy-simulation>custom element. - Powered by @kajws/galaxy-js: The core simulation logic is provided by the
@kajws/galaxy-jslibrary.
Demo
See index.html for a live demo.
Installation
To install the component, you can use any package manager:
npm install @kajws/galaxy-vror
pnpm install @kajws/galaxy-vrUsage
Embed the component in your HTML and import the module:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Galaxy VR</title>
<style>
body {
margin: 0;
height: 100vh;
}
vr-galaxy-simulation {
display: block;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<vr-galaxy-simulation></vr-galaxy-simulation>
<script type="module">
import 'galaxy-vr';
</script>
</body>
</html>Development
To run the project locally, follow these steps:
Clone the repository:
git clone https://github.com/kajws/galaxy-js.git cd galaxy-js/galaxy-vrInstall dependencies:
pnpm installStart the development server:
pnpm run dev
Building
To build the component for production, run:
pnpm run buildThis will generate the necessary files in the dist directory.
Contributing
Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.
License
This project is licensed under the MIT License.
