Add stage

This commit is contained in:
Diego Marcos
2018-09-12 14:08:11 -07:00
parent 2d58db4db1
commit 4d3b8ecb31
9 changed files with 396 additions and 4 deletions

View File

@@ -0,0 +1,17 @@
AFRAME.registerSystem('materials', {
init: function () {
this.black = new THREE.MeshLambertMaterial({color: 0x000000, flatShading: true});
this.default = new THREE.MeshLambertMaterial({color: 0xff0000, flatShading: true});
this.neon = new THREE.MeshBasicMaterial({color: 0x9999ff, fog: false});
}
});
AFRAME.registerComponent('materials', {
schema: {
default: 'black',
oneOf: ['black', 'red', 'blueneon']
},
update: function () {
this.el.object3D.traverse(o => o.material = this.system[this.data]);
}
});