Add stage
This commit is contained in:
17
src/components/materials.js
Normal file
17
src/components/materials.js
Normal 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]);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user