JSON导入不在Three.JS r74中投射阴影

时间:2016-01-19 08:25:47

标签: javascript json three.js

我在Blender中创建一个简单的平面时遇到问题,导入到Three.js时投下阴影

这是我的相关代码:

let material = new THREE.MeshPhongMaterial( { 
  color: 0x00ff00, 
  morphTargets: true,
  side: THREE.DoubleSide
});
this.paper = new THREE.Mesh(geometry, material);
this.paper.castShadow = true;
this.paper.receiveShadow = true;
ThreeHub.scene.add(this.paper);

this.mixer = new THREE.AnimationMixer(this.paper);
let clip = THREE.AnimationClip.CreateFromMorphTargetSequence('fallingPaper', this.paper.geometry.morphTargets, 60);
let action = new THREE.AnimationAction(clip, 0, 1, 1, THREE.LoopOnce);
this.mixer.addAction(action);

ThreeHub.scene.renderer.addRenderCallback('animation.paper', () => {
  this.mixer.update(ThreeHub.clock.getDelta());
})

纸张没有孩子。您可以在https://gist.github.com/tomlagier/1b972b2b4d914f1ba71d

查看我的JSON文件

您可以看到http://tomlagier.github.io/threejs-falling-paper/target/

上托管的场景

添加到我的场景中的基本对象正确投射阴影,所以我知道这个对象存在问题。

0 个答案:

没有答案