ThreeJS动画几何体不会更新但位置会更新吗?

时间:2015-09-19 06:47:29

标签: javascript 3d three.js ecmascript-6 blender

我将通过说我是Blender / 3DS MAX / ThreeJS和图形编程的新手来做序。

我导出了一个Mutalisk(来自星际争霸)的动画,它从星际争霸编辑器中扇动翅膀作为.m3文件,我导入了Blender。导出后,我能够将生成的.json导入到我的ES6应用程序中,但由于某种原因,使用THREE.Animation,而导入的Mutalisk的位置正确地改变,它会四处乱窜,Mutalisk对象的实际抖动不会不会发生。

我的渲染器看起来像这样:

import THREE from 'three';

export default class Renderer {
  constructor(game, canvas) {
    this.game = game;
    this.canvas = canvas;

    this.scene = new THREE.Scene();

    this.camera = new THREE.PerspectiveCamera(75, this.canvas.width / this.canvas.height, 1, 10000);
    this.camera.position.z = 2;
    this.camera.position.y = 1;

    this.clock = new THREE.Clock;

    this.renderer = new THREE.WebGLRenderer({ canvas: this.canvas });
    this.renderer.setSize( this.canvas.width, this.canvas.height );
  }

  // called by my Game class, which waits for the mesh to load before attempting to add it to the scene
  addMeshToScene(mesh) {
    this.mesh = mesh;

    this.scene.add(this.mesh);

    this.animation = new THREE.Animation(
      this.mesh,
      this.mesh.geometry.animations[ 2 ]
    );

    this.animation.play();
  }

  renderFrame() {
    THREE.AnimationHandler.update(this.clock.getDelta());

    this.renderer.render(this.scene, this.camera);
  }
}

这是渲染。正如我所说,浏览器中的Mutalisk沿着Y轴反弹,但没有拍打。

mutalisk

任何人都可以解释为什么运动会发生,而不是拍打?

编辑:这是我的Blender导出设置。

blender settings

0 个答案:

没有答案