소스 검색

Examples: Simplified webgl_morphtargets_sphere.

Mr.doob 4 년 전
부모
커밋
bb484d6169
1개의 변경된 파일1개의 추가작업 그리고 14개의 파일을 삭제
  1. 1 14
      examples/webgl_morphtargets_sphere.html

+ 1 - 14
examples/webgl_morphtargets_sphere.html

@@ -54,37 +54,24 @@
 				const loader = new GLTFLoader();
 				loader.load( 'models/gltf/AnimatedMorphSphere/glTF/AnimatedMorphSphere.gltf', function ( gltf ) {
 
-					gltf.scene.traverse( function ( node ) {
-
-						if ( node.isMesh ) mesh = node;
-
-					} );
-
+					mesh = gltf.scene.getObjectByName( 'AnimatedMorphSphere' );
 					mesh.material.morphTargets = true;
-
 					mesh.rotation.z = Math.PI / 2;
-
-					//mesh.material.visible = false;
-
 					scene.add( mesh );
 
 					//
 
 					const pointsMaterial = new THREE.PointsMaterial( {
-
 						size: 10,
 						sizeAttenuation: false,
 						map: new THREE.TextureLoader().load( 'textures/sprites/disc.png' ),
 						alphaTest: 0.5,
 						morphTargets: true
-
 					} );
 
 					const points = new THREE.Points( mesh.geometry, pointsMaterial );
-
 					points.morphTargetInfluences = mesh.morphTargetInfluences;
 					points.morphTargetDictionary = mesh.morphTargetDictionary;
-
 					mesh.add( points );
 
 				} );