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

25 lines
539 B
JavaScript

import * as THREE from 'three';
import Config from '../../data/config';
// USe this class as a helper to set up some default materials
export default class Material {
constructor(color) {
this.basic = new THREE.MeshBasicMaterial({
color,
side: THREE.DoubleSide
});
this.standard = new THREE.MeshStandardMaterial({
color,
shading: THREE.FlatShading,
roughness: 1,
metalness: 0,
side: THREE.DoubleSide
});
this.wire = new THREE.MeshBasicMaterial({wireframe: true});
}
}