From ac4cbd8760950a9d532653c69e602249723e92a0 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Sat, 11 Jul 2015 18:19:06 -0400 Subject: [PATCH] Cleaned up cloth example. --- examples/webgl_animation_cloth.html | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/examples/webgl_animation_cloth.html b/examples/webgl_animation_cloth.html index b314c3ae6b..b788f29fa4 100644 --- a/examples/webgl_animation_cloth.html +++ b/examples/webgl_animation_cloth.html @@ -128,7 +128,7 @@ var clothGeometry; var sphere; - var object, arrow; + var object; var rotate = true; @@ -143,7 +143,6 @@ // scene scene = new THREE.Scene(); - scene.fog = new THREE.Fog( 0xcce0ff, 500, 10000 ); // camera @@ -164,7 +163,7 @@ light.position.multiplyScalar( 1.3 ); light.castShadow = true; - //light.shadowCameraVisible = true; + // light.shadowCameraVisible = true; light.shadowMapWidth = 1024; light.shadowMapHeight = 1024; @@ -187,7 +186,14 @@ clothTexture.wrapS = clothTexture.wrapT = THREE.RepeatWrapping; clothTexture.anisotropy = 16; - var clothMaterial = new THREE.MeshPhongMaterial( { alphaTest: 0.5, color: 0xffffff, specular: 0x030303, emissive: 0x111111, shiness: 10, map: clothTexture, side: THREE.DoubleSide } ); + var clothMaterial = new THREE.MeshPhongMaterial( { + specular: 0x030303, + emissive: 0x111111, + shiness: 10, + map: clothTexture, + side: THREE.DoubleSide, + alphaTest: 0.5 + } ); // cloth geometry clothGeometry = new THREE.ParametricGeometry( clothFunction, cloth.w, cloth.h ); @@ -205,7 +211,12 @@ object.receiveShadow = true; scene.add( object ); - object.customDepthMaterial = new THREE.ShaderMaterial( { uniforms: uniforms, vertexShader: vertexShader, fragmentShader: fragmentShader, side: THREE.DoubleSide } ); + object.customDepthMaterial = new THREE.ShaderMaterial( { + uniforms: uniforms, + vertexShader: vertexShader, + fragmentShader: fragmentShader, + side: THREE.DoubleSide + } ); // sphere @@ -217,12 +228,6 @@ sphere.receiveShadow = true; scene.add( sphere ); - // arrow - - arrow = new THREE.ArrowHelper( new THREE.Vector3( 0, 1, 0 ), new THREE.Vector3( 0, 0, 0 ), 50, 0xff0000 ); - arrow.position.set( -200, 0, -200 ); - // scene.add( arrow ); - // ground var groundTexture = THREE.ImageUtils.loadTexture( "textures/terrain/grasslight-big.jpg" ); @@ -327,8 +332,6 @@ windStrength = Math.cos( time / 7000 ) * 20 + 40; windForce.set( Math.sin( time / 2000 ), Math.cos( time / 3000 ), Math.sin( time / 1000 ) ).normalize().multiplyScalar( windStrength ); - arrow.setLength( windStrength ); - arrow.setDirection( windForce ); simulate(time); render(); -- GitLab