When trying to add a dae file into my scene, I get this error at the line where I render. DAE file is attached.
piper_idle.dae (1.4 MB)
three.module.js:32346 Uncaught TypeError: Cannot read properties of undefined (reading 'matrixWorld')
at SkinnedMesh.applyBoneTransform (three.module.js:32346:60)
at SkinnedMesh.getVertexPosition (three.module.js:32247:8)
at SkinnedMesh.computeBoundingSphere (three.module.js:32184:9)
at Frustum.intersectsObject (three.module.js:13703:49)
at projectObject (three.module.js:29801:46)
at projectObject (three.module.js:29859:5)
at projectObject (three.module.js:29859:5)
at projectObject (three.module.js:29859:5)
at WebGLRenderer.render (three.module.js:29644:4)
at eval (Game.ts:162:27)
const path = "/brawlers/piper/piper_idle.dae";
this.loader.load(path, (collada) => {
const model = collada.scene;
model.position.set(0, 0, 0);
this.scene.add(model);
});
setTimeout(() => {
this.renderer.render(this.scene, this.camera);
}, 5000);
This is only a simple reproduction, this is my real code (when I uncomment this line, it crashes on the render call). It seems to work when I import it into MeshLab but not in this Three.js viewer: Three.js Model Viewer
I also tried another model to see if it was a problem with all dae files but it rendered without problem.
Would appreciate any help!