📜  threejs 如何围绕对象自己的中心而不是世界中心旋转 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:32.193000             🧑  作者: Mango

代码示例1
this.loaderGLTF.load('assets/epson.glb', (gltf: GLTF) => {
      this.model = gltf.scene;
      var box = new THREE.Box3().setFromObject(this.model);
      box.getCenter(this.model.position); // this re-sets the mesh position
      this.model.position.multiplyScalar(- 1);
      this.scene.add(this.model);
    });