hmans / three-elements

Web Components-powered custom HTML elements for building Three.js-powered games and interactive experiences. πŸŽ‰
https://three-elements.hmans.co
MIT License
398 stars 14 forks source link
3d-scene custom-elements dom html-elements threejs web-components webgl

New Maintainer Wanted!

I am no longer working on this library (since I am also no longer using it, unfortunately.) If you're interested in taking over, please contact me at hendrik@mans.de. Thanks!




Version Version CI Downloads Bundle Size Discord

 __   __    πŸ—»     πŸ—»   β›°
|  |_|  |--.----.-----.-----.          πŸ¦…                                      🌞
|   _|     |   _|  -__|  -__|
|____|__|__|__| |_____|_____|  πŸ—»  🌲🌳      __  🌲  🌳                πŸ¦…
    .-----.|  |.-----.--------.-----.-----.|  |_.-----.
    |  -__||  ||  -__|        |  -__|     ||   _|__ --|
    |_____||__||_____|__|__|__|_____|__|__||____|_____|   🌳🌲 🏑 🌲   🌲🌳  πŸ„   🌲 🌲🌳     🌳

three-elements provides Web Components-powered custom HTML elements for building Three.js-powered games and interactive experiences. πŸŽ‰

WARNING: It is early days for this library, so please proceed with caution!

<!-- Load three-elements -->
<script type="module" src="https://jspm.dev/three-elements"></script>

<!-- Create a Three.js game with a default camera. -->
<three-game autorender>
  <three-scene background-color="#444">
    <!-- Lights on! -->
    <three-ambient-light intensity="0.2"></three-ambient-light>
    <three-directional-light intensity="0.8" position="10, 10, 50"></three-directional-light>

    <!-- Spinning dodecahedron! -->
    <three-mesh tick="object.rotation.z += dt">
      <three-dodecahedron-buffer-geometry></three-dodecahedron-buffer-geometry>
      <three-mesh-standard-material color="red"></three-mesh-standard-material>
    </three-mesh>
  </three-scene>
</three-game>

DOCUMENTATION

COMMUNITY

CONTRIBUTING

Please get in touch before submitting Pull Requests (ideally, before even implementing them.) At this stage in its development, three-elements still is heavily in flux. If there is something you would like to contribute, please open an issue and describe your suggestion.

If you want to do some hacking, just run yarn dev, which will compile the package in watch mode and spawn a server on localhost:5000 that serves the contents of the examples/ directory.

THANKS