Skip to content

Commit

Permalink
Examples: Simplified webgl_morphtargets_sphere.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jul 11, 2021
1 parent 712140a commit bb484d6
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions examples/webgl_morphtargets_sphere.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

} );
Expand Down

0 comments on commit bb484d6

Please sign in to comment.