Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法使用onProgress监听模型加载进度 #10

Open
dadwadw233 opened this issue Jun 27, 2022 · 0 comments
Open

无法使用onProgress监听模型加载进度 #10

dadwadw233 opened this issue Jun 27, 2022 · 0 comments

Comments

@dadwadw233
Copy link

gltfLoader.load(url, (gltf) => {
     console.log("strat to load model");
     const root = gltf.scene;
     scene.add(root);
      root.updateMatrixWorld();
      const box = new THREE.Box3().setFromObject(root);
      const boxSize = box.getSize(new THREE.Vector3()).length();
      const boxCenter = box.getCenter(new THREE.Vector3());
      frameArea(boxSize * 0.5, boxSize, boxCenter, camera);
      controls.maxDistance = boxSize * 100;
      controls.target.copy(boxCenter);
      controls.update();
      getChild();
      return "ok"
    },  onProgress=function ( xhr ) {
      console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
  },);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant