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

25 lines
539 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
// 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(color) {
this.basic = new THREE.MeshBasicMaterial({
color,
2016-10-07 08:42:23 +00:00
side: THREE.DoubleSide
2016-09-12 19:54:07 +00:00
});
this.standard = new THREE.MeshStandardMaterial({
color,
2016-09-12 19:54:07 +00:00
shading: THREE.FlatShading,
roughness: 1,
metalness: 0,
2016-10-07 08:42:23 +00:00
side: THREE.DoubleSide
});
2016-09-12 19:54:07 +00:00
this.wire = new THREE.MeshBasicMaterial({wireframe: true});
}
}