react-three-renderer icon indicating copy to clipboard operation
react-three-renderer copied to clipboard

Support morphTarget and morphTargetInfluences

Open shampliu opened this issue 7 years ago • 3 comments
trafficstars

shampliu avatar Jan 08 '18 23:01 shampliu

Relevant: https://threejs.org/docs/index.html#api/objects/Mesh.morphTargetDictionary

toxicFork avatar Jan 11 '18 07:01 toxicFork

Hey, I'd like to work on this if nobody has started already. I have been trying to implement the THREE.js Hemisphere Lights example (https://threejs.org/examples/?q=hemisp#webgl_lights_hemisphere) and ran into a morphTargetInfluences error. Right now the only solution I've come up with is to manually scene.add(mesh).

Here is the code from the example -

var material = new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0xffffff, shininess: 20, morphTargets: true, vertexColors: THREE.FaceColors, flatShading: true } );
var mesh = new THREE.Mesh( geometry, material );

var s = 0.35;
mesh.scale.set( s, s, s );
mesh.position.y = 15;
mesh.rotation.y = -1;
mesh.castShadow = true;
mesh.receiveShadow = true;

scene.add( mesh );

var mixer = new THREE.AnimationMixer( mesh );
mixer.clipAction( geometry.animations[ 0 ] ).setDuration( 1 ).play();
mixers.push( mixer );

@toxicFork If you haven't started on this already, let me know and I'll see what I can do. If you have any pointers or ideas, I'd be happy to hear them as well. Right now I'm not sure how to decouple the AnimationMixer from the element.

johnmarinelli avatar Jan 18 '18 09:01 johnmarinelli

Thank you for offering your help, it will be greatly appreciated!!

On Thu, Jan 18, 2018, 09:53 John Marinelli [email protected] wrote:

Hey, I'd like to work on this if nobody has started already. I have been trying to implement the THREE.js Hemisphere Lights example ( https://threejs.org/examples/?q=hemisp#webgl_lights_hemisphere) and ran into a morphTargetInfluences error. Right now the only solution I've come up with is to manually scene.add(mesh).

Here is the code from the example -

var material = new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0xffffff, shininess: 20, morphTargets: true, vertexColors: THREE.FaceColors, flatShading: true } ); var mesh = new THREE.Mesh( geometry, material );

  			var s = 0.35;
  			mesh.scale.set( s, s, s );
  			mesh.position.y = 15;
  			mesh.rotation.y = -1;

  			mesh.castShadow = true;
  			mesh.receiveShadow = true;

  			scene.add( mesh );

  			var mixer = new THREE.AnimationMixer( mesh );
  			mixer.clipAction( geometry.animations[ 0 ] ).setDuration( 1 ).play();
  			mixers.push( mixer );

@toxicFork https://github.com/toxicfork If you haven't started on this already, let me know and I'll see what I can do. If you have any pointers or ideas, I'd be happy to hear them as well. Right now I'm not sure how to decouple the AnimationMixer from the element.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/toxicFork/react-three-renderer/issues/209#issuecomment-358595064, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0iLZnqb3SI25BJdCCd31UhAxYMoRrLks5tLxSDgaJpZM4RXHY6 .

toxicFork avatar Jan 18 '18 10:01 toxicFork