Parcourir la source

Examples: Improved webgl_materials_variations_toon.

Mr.doob il y a 5 ans
Parent
commit
c020570477
1 fichiers modifiés avec 7 ajouts et 15 suppressions
  1. 7 15
      examples/webgl_materials_variations_toon.html

+ 7 - 15
examples/webgl_materials_variations_toon.html

@@ -43,14 +43,8 @@
 
 				//
 
-				var reflectionCube = new THREE.CubeTextureLoader()
-					.setPath( 'textures/cube/SwedishRoyalCastle/' )
-					.load( [ 'px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg' ] );
-				reflectionCube.format = THREE.RGBFormat;
-				reflectionCube.encoding = THREE.sRGBEncoding;
-
 				scene = new THREE.Scene();
-				scene.background = reflectionCube;
+				scene.background = new THREE.Color( 0x444488 );
 
 				// Materials
 
@@ -132,18 +126,21 @@
 				addLabel( "-diffuse", new THREE.Vector3( 0, 0, - 300 ) );
 				addLabel( "+diffuse", new THREE.Vector3( 0, 0, 300 ) );
 
-				particleLight = new THREE.Mesh( new THREE.SphereBufferGeometry( 4, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0xffffff } ) );
+				particleLight = new THREE.Mesh(
+					new THREE.SphereBufferGeometry( 4, 8, 8 ),
+					new THREE.MeshBasicMaterial( { color: 0xffffff } )
+				);
 				scene.add( particleLight );
 
 				// Lights
 
-				scene.add( new THREE.AmbientLight( 0x222222 ) );
+				scene.add( new THREE.AmbientLight( 0x111111 ) );
 
 				var directionalLight = new THREE.DirectionalLight( 0xffffff, 1 );
 				directionalLight.position.set( 1, 1, 1 ).normalize();
 				scene.add( directionalLight );
 
-				var pointLight = new THREE.PointLight( 0xffffff, 2, 800 );
+				var pointLight = new THREE.PointLight( 0xffffff, 1, 800 );
 				particleLight.add( pointLight );
 
 				//
@@ -192,11 +189,6 @@
 
 				var timer = Date.now() * 0.00025;
 
-				//camera.position.x = Math.cos( timer ) * 800;
-				//camera.position.z = Math.sin( timer ) * 800;
-
-				camera.lookAt( scene.position );
-
 				particleLight.position.x = Math.sin( timer * 7 ) * 300;
 				particleLight.position.y = Math.cos( timer * 5 ) * 400;
 				particleLight.position.z = Math.cos( timer * 3 ) * 300;