|
@@ -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 );
|
|
|
|
|
|
} );
|