import * as THREE from 'three' ; param materialColor param materialName param depthWrite export function appliedMaterial ( materialColor , materialName ? , depthWrite ? ) { const props = { color : ( materialColor instanceof THREE . Color ? materialColor : new THREE . Color ( materialColor ) ) , side : THREE . DoubleSide , depthWrite : ( depthWrite !== undefined ? depthWrite : true ) } ; if ( materialName === 'lamb' ) { return new THREE . MeshLambertMaterial ( props ) ; } else if ( materialName === 'basic' ) { return new THREE . MeshBasicMaterial ( props ) ; } else { return new THREE . MeshPhongMaterial ( props ) ; } }