MeshPhongMaterial.js 834 字节
Newer Older
1 2 3 4 5 6
/**
 * @author alteredq / http://alteredqualia.com/
 */

THREE.MeshPhongMaterial = function ( ambient, diffuse, specular, shininess, opacity ) {

7 8 9 10 11 12
	this.ambient = new THREE.Color( ( opacity !== undefined ? opacity : 1 ) * 0xff << 24 ^ ambient );
	this.diffuse = new THREE.Color( ( opacity !== undefined ? opacity : 1 ) * 0xff << 24 ^ diffuse );
	this.specular = new THREE.Color( ( opacity !== undefined ? opacity : 1 ) * 0xff << 24 ^ specular );

	this.shininess = shininess;
	this.opacity = opacity;
13 14 15 16 17 18 19 20 21 22 23 24

	this.toString = function () {

		return 'THREE.MeshPhongMaterial ( <br/>ambient: ' + this.ambient 
                + ', <br/>diffuse: ' + this.diffuse 
                + ', <br/>specular: ' + this.specular 
                + ', <br/>shininess: ' + this.shininess 
                + ', <br/>opacity: ' + this.opacity + ')';

	};

};