Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/karimbeyrouti/ember-three-ui

Structure ThreeJS with Ember using templates
https://github.com/karimbeyrouti/ember-three-ui

ember threejs

Last synced: 9 days ago
JSON representation

Structure ThreeJS with Ember using templates

Awesome Lists containing this project

README

        

ember-three-ui
==============================================================================

This addon enables three.js scene hierarchy to be composed in templates.
It currently support a small subset of the functionality provided by three.js, there
is lots to add and improve. However, hopefully this is a solid foundation for
future development.

This is the handlebars template for a simple scene:

```handlebars




```

and the corresponding JavaScript:

```javascript
import THREE from 'three';
import { inject as service } from '@ember/service';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';

export default class DemoComponent extends Component {
@service('ember-three/scene-manager') sceneManager;
@tracked rotation = new THREE.Vector3();

cameraPosition = new THREE.Vector3(0, 0, 5);
geometry = new THREE.BoxGeometry(1, 1, 1);
material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });

constructor() {
super(...arguments);
let emberThree = this.sceneManager.get(this.sceneId);
emberThree.addRafCallback(this.render, this);
}

render() {
this.rotation.x += 0.01;
this.rotation.y += 0.01;
this.rotation = this.rotation;
}
}
```

[this](https://karimbeyrouti.github.io/ember-three-ui/?id=simple-scene) is what you should see.

Compatibility
------------------------------------------------------------------------------

* Ember.js v2.18 or above
* Ember CLI v2.13 or above
* Node.js v8 or above

Installation
------------------------------------------------------------------------------

```
ember install ember-three-ui
```

Demo
------------------------------------------------------------------------------
https://karimbeyrouti.github.io/ember-three-ui/

Usage
------------------------------------------------------------------------------

...

Contributing
------------------------------------------------------------------------------

See the [Contributing](CONTRIBUTING.md) guide for details.

License
------------------------------------------------------------------------------

This project is licensed under the [MIT License](LICENSE.md).