/** * @author mr.doob / http://mrdoob.com/ * @author alteredq / http://alteredqualia.com/ * * parameters = { * color: , * ambient: , * specular: , * shininess: , * map: new THREE.Texture( ), * specular_map: new THREE.Texture( ), * env_map: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ), * combine: THREE.Multiply, * reflectivity: , * refraction_ratio: , * opacity: , * shading: THREE.SmoothShading, * blending: THREE.NormalBlending, * wireframe: , * wireframe_linewidth: * } */ THREE.MeshPhongMaterial = function ( parameters ) { this.id = THREE.MeshPhongMaterialCounter.value ++; this.color = new THREE.Color( 0xeeeeee ); this.ambient = new THREE.Color( 0x050505 ); this.specular = new THREE.Color( 0x111111 ); this.shininess = 30; this.map = null; this.specular_map = null; this.env_map = null; this.combine = THREE.Multiply; this.reflectivity = 1; this.refraction_ratio = 0.98; this.opacity = 1; this.shading = THREE.SmoothShading; this.blending = THREE.NormalBlending; this.wireframe = false; this.wireframe_linewidth = 1; if ( parameters ) { if ( parameters.color !== undefined ) this.color = new THREE.Color( parameters.color ); if ( parameters.ambient !== undefined ) this.ambient = new THREE.Color( parameters.ambient ); if ( parameters.specular !== undefined ) this.specular = new THREE.Color( parameters.specular ); if ( parameters.shininess !== undefined ) this.shininess = parameters.shininess; if ( parameters.map !== undefined ) this.map = parameters.map; if ( parameters.specular_map !== undefined ) this.specular_map = parameters.specular_map; if ( parameters.env_map !== undefined ) this.env_map = parameters.env_map; if ( parameters.combine !== undefined ) this.combine = parameters.combine; if ( parameters.reflectivity !== undefined ) this.reflectivity = parameters.reflectivity; if ( parameters.refraction_ratio !== undefined ) this.refraction_ratio = parameters.refraction_ratio; if ( parameters.opacity !== undefined ) this.opacity = parameters.opacity; if ( parameters.shading !== undefined ) this.shading = parameters.shading; if ( parameters.blending !== undefined ) this.blending = parameters.blending; if ( parameters.wireframe !== undefined ) this.wireframe = parameters.wireframe; if ( parameters.wireframe_linewidth !== undefined ) this.wireframe_linewidth = parameters.wireframe_linewidth; } this.toString = function () { return 'THREE.MeshPhongMaterial (
' + 'id: ' + this.id + '
' + 'color: ' + this.color + '
' + 'ambient: ' + this.ambient + '
' + 'specular: ' + this.specular + '
' + 'shininess: ' + this.shininess + '
' + 'map: ' + this.map + '
' + 'specular_map: ' + this.specular_map + '
' + 'env_map: ' + this.env_map + '
' + 'combine: ' + this.combine + '
' + 'reflectivity: ' + this.reflectivity + '
' + 'refraction_ratio: ' + this.refraction_ratio + '
' + 'opacity: ' + this.opacity + '
' + 'shading: ' + this.shading + '
' + 'wireframe: ' + this.wireframe + '
' + 'wireframe_linewidth: ' + this.wireframe_linewidth + '
' + + ')'; }; }; THREE.MeshPhongMaterialCounter = { value: 0 };