Giter Site home page Giter Site logo

pookage / hmans-three-elements Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hmans/three-elements

0.0 0.0 0.0 5.59 MB

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

Home Page: https://three-elements.hmans.co

License: MIT License

JavaScript 6.11% TypeScript 55.34% CSS 0.33% HTML 37.17% Vue 0.91% Stylus 0.14%

hmans-three-elements's Introduction

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 [email protected]. 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!

  • Directly exposes all Three.js classes as HTML elements (eg. <three-mesh> for THREE.Mesh!)
  • Elements are fully reactive; if their attributes change, this is immediately reflected in the Three.js scene.
  • Optimized rendering: Frames are only rendered when something has changed in the scene, or if your code explicitly requests it.
  • Input event handling: Your 3D scene automatically handles pointer events (clicks, hover, etc). Just hook into the same HTML DOM events you would use in any other web application (onclick et al.)
  • Use it with any framework that emits or modifies HTML DOM, or no framework at all!
  • Works with any version of Three.js, including your own fork if you have one.
  • Built-in templating support lets you reuse objects or entire scenes across your project without the need for any JavaScript component framework.
<!-- 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

  • Three.js for being the 3D library for the web.
  • A-Frame for introducing Web Components-powered easy to use 3D and VR.
  • react-three-fiber for its smart approach of mirroring THREE.* classes 1:1 instead of building a library of custom components.

hmans-three-elements's People

Contributors

hmans avatar dependabot[bot] avatar pandasekh avatar codyjasonbennett avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.