Answers for "threejs how to rotate around object's own center,instead of world center"

0

threejs how to rotate around object's own center,instead of world center

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);
    });
Posted by: Guest on September-03-2021

Code answers related to "threejs how to rotate around object's own center,instead of world center"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language