ThreeJS-Webpack-ES6-Boilerp.../src/js/app/helpers/material.js

28 lines
591 B
JavaScript
Raw Normal View History

import * as THREE from 'three';
2016-09-12 19:54:07 +00:00
import Config from '../../data/config';
2016-09-12 19:54:07 +00:00
2016-10-07 08:42:23 +00:00
// USe this class as a Helper to set up some default materials
2016-09-12 19:54:07 +00:00
export default class Material {
constructor() {
this.emissive = new THREE.MeshBasicMaterial({
color: 0xeeeeee,
2016-10-07 08:42:23 +00:00
side: THREE.DoubleSide
2016-09-12 19:54:07 +00:00
});
this.standard = new THREE.MeshStandardMaterial({
shading: THREE.FlatShading,
roughness: 1,
metalness: 0,
2016-10-07 08:42:23 +00:00
side: THREE.DoubleSide
});
this.phong = new THREE.MeshPhongMaterial({
2016-09-12 19:54:07 +00:00
});
this.wire = new THREE.MeshBasicMaterial({wireframe: true});
}
}