• This repository has been archived on 04/Apr/2022
  • Stars
    star
    398
  • Rank 108,325 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 4 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

miniplex

A ๐Ÿ‘ฉโ€๐Ÿ’ป developer-friendly entity management system for ๐Ÿ•น games and similarly demanding applications, based on ๐Ÿ›  ECS architecture.
TypeScript
827
star
2

composer-suite

A suite of libraries for making game development with Three.js and React not only awesome, but so good, it would feel wrong to use anything else.
TypeScript
469
star
3

slodown

Markdown + oEmbed + Sanitize + CodeRay = the ultimate user input rendering pipeline!
Ruby
251
star
4

rbfu

Minimal Ruby version management is minimal.
Shell
118
star
5

shader-composer

80
star
6

schnitzelpress

A lean, mean blogging machine for hackers and fools.
Ruby
77
star
7

statery

Surprise-Free State Management! Designed for React with functional components, but can also be used with other frameworks (or no framework at all.)
TypeScript
72
star
8

happy

A happy little toolkit for writing web applications.
Ruby
66
star
9

pants

PANTS: Distributed Social Blogging.
Ruby
64
star
10

controlfreak

Composable Game Input.
TypeScript
59
star
11

flutterby

A flexible, Ruby-powered static site generator.
Ruby
57
star
12

timeline-composer

Compose React timelines from <Repeat>, <Delay> and <Lifetime>.
19
star
13

eventery

Super-lightweight event class implementation. ๐Ÿš€
TypeScript
19
star
14

Godot-RigidBody-Auto-Scaler

Want to scale rigidbodies in Godot? Now you can. ๐Ÿš€
GDScript
17
star
15

allowance

Allowance is a general-use permission management library for Ruby. It's decidedly simple, highly flexible, and has out-of-the-box support for ActiveModel-compliant classes.
Ruby
16
star
16

space-scene-sandbox

TypeScript
15
star
17

indiepants

IndiePants, aka Pants Phase 2. A clean indieweb-like implementation.
Ruby
13
star
18

hamburg-io

A hub for the Hamburg tech community.
Ruby
10
star
19

trinity

TypeScript
9
star
20

trinity-legacy

TypeScript
7
star
21

create-react-game

JavaScript
7
star
22

godot-survival-guide

Assorted Workarounds and Dirty Hacks for Stuff That's Missing, Broken, or Otherwise Weird in the Godot Engine
7
star
23

things

TypeScript
7
star
24

signal

TypeScript
6
star
25

react-game-starter

TypeScript
5
star
26

bigby-legacy

TypeScript
5
star
27

crankypants

A thing that does things.
Crystal
5
star
28

Godot-ParticlesPortal

GDScript
4
star
29

spacerage-one

Dumb little web-based space shootybang. (Yes, that's an actual genre.)
CoffeeScript
4
star
30

material-composer

4
star
31

awesome-freelancing-germany

Nรผtzliche Ressourcen fรผr Freelancer in Deutschland.
4
star
32

three-vfx-starter

JavaScript
4
star
33

supermutant

EMBRACE THE MUTATION and turn any JavaScript object into a SUPERMUTANT REACTIVE STATE CONTAINER. UUUAAAAAHHHHHHHHHHHRRRRRR
TypeScript
4
star
34

lit-shootybang

JavaScript
3
star
35

schnitzelpress-skeleton

Schnitzelpress Skeleton App. Clone/fork/download this as a base for your own Schnitzelpress powered blog.
Ruby
3
star
36

solid-trinity

TypeScript
3
star
37

spacerage.liveview

Phoenix + LiveView + three-elements = ?
Elixir
3
star
38

spacerage.6dof

Space pew pew using react-three-fiber.
TypeScript
3
star
39

fantasy-js-physics-engine

2
star
40

hmansify

Some stuff from my home directory.
Ruby
2
star
41

happy-resources

A collection of resource-focused controllers for the Happy Web Application Toolkit.
Ruby
2
star
42

ingrid

Spatial Hash Grids and not much else.
TypeScript
2
star
43

bumpy

Bumpy bumps your gem's version number.
Ruby
2
star
44

webmade.games

https://webmade.games
Astro
2
star
45

hmans_me

My blog, as seen on http://hmans.io. Powered by Flutterby.
CSS
2
star
46

randomish

TypeScript
2
star
47

render-composer

2
star
48

flutterby-website

The official website for Flutterby.
Ruby
2
star
49

indiepants-docker

Docker & Fig configuration for painless IndiePants deployment.
2
star
50

playground

A collection of experimental react-three-fiber tools and toys that aren't quite ready to be released as their own packages.
JavaScript
2
star
51

particulous

A playground for exploring patterns around CPU-based particle systems.
TypeScript
2
star
52

shadenfreude-planet

Created with CodeSandbox
TypeScript
2
star
53

bevy-mrp-macos-performance

Rust
2
star
54

panties

Command line client for #pants.
Ruby
1
star
55

happy-helpers

[Deprecated!] View helpers for your custom Rack app or framework.
Ruby
1
star
56

publicbox

Serves JSON indices of your favorite public Dropbox folders.
Ruby
1
star
57

resourcery

It's resource sorcery! Or something.
Ruby
1
star
58

imaginary

Client gem for Imaginary.
Ruby
1
star
59

happy-cli

Command line tool for the Happy web application toolkit.
Ruby
1
star
60

xml-muncher

TypeScript
1
star
61

Godot4-Node-Performance

GDScript
1
star
62

twotter

TWOTTER ๐Ÿฆ† - a little playground app for my Ruby on Rails trainings.
Ruby
1
star
63

glowlayer

Experimental Glow Layer for Three.js
JavaScript
1
star
64

compass-naked

An experimental Rack-only app I'm using to find the easiest way to integrate Compass with Tilt.
Ruby
1
star
65

trinity-examples

A collection of examples for (and experiments with) the Trinity framework.
JavaScript
1
star
66

schnitzel-rails-template

The Team Schnitzel Rails application template. \o/
Ruby
1
star
67

schnitzelpress-org

The source code for schnitzelpress.org.
Ruby
1
star
68

splodybox

A VFX/R3F demo
JavaScript
1
star
69

spacerage

TypeScript
1
star
70

schnitzelstyle

A tiny, light-weight, hopefully sane CSS framework with a Schnitzel flavor.
Ruby
1
star
71

hmans_net

My personal weblog, powered by SchnitzelPress (www.schnitzelpress.org)
Ruby
1
star
72

three-increments

TypeScript
1
star
73

fun-with-kittehs-presentation

Fun With Kittehs. Yeah.
1
star
74

learn-bevy-cube-of-cubes

Rust
1
star