Hi everyone,
I’m working on a Three.js project where I need to place multiple instances of 3D models in a scene using instanced meshes. However, I’m encountering an issue where the instances are not retaining their positions correctly. The instances either all move to a new position or do not retain their intended positions. (there’s also some shading issues, but ill tackle that later).
I have attached all relevant files along a video showing the issue as well as some logs i used for debugging.
Any help is greatly appreciated. If the task is too complex I can offer some incentive. I don’t have much, but i am willing to discuss.
bitbox.js:193 Intersect at: -26.720457220391516, 0, -251.59985348890086
bitbox.js:97 Selected asset: big_tree_foliage_single_LOD0_jungle_mat_0.glb
bitbox.js:193 Intersect at: -91.35863718332138, 0, 297.2136667639786
bitbox.js:130 Added new instanced mesh for big_tree_foliage_single_LOD0_jungle_mat_0.glb with count 100
bitbox.js:146 Placing at position: -90, 0, 300
bitbox.js:151 Instanced mesh count after placing: 101
bitbox.js:152 Matrix for new instance: 1,0,0,0,0,1,0,0,0,0,1,0,-90,0,300,1
bitbox.js:157 InstancedMesh position: -90,0,300
bitbox.js:158 InstancedMesh matrix: 1,0,0,0,0,1,0,0,0,0,1,0,-90,0,300,1
bitbox.js:193 Intersect at: -280.85688927512615, 0, -304.43468858906783
bitbox.js:146 Placing at position: -280, 0, -300
bitbox.js:151 Instanced mesh count after placing: 102
bitbox.js:152 Matrix for new instance: 1,0,0,0,0,1,0,0,0,0,1,0,-280,0,-300,1
bitbox.js:157 InstancedMesh position: -280,0,-300
bitbox.js:158 InstancedMesh matrix: 1,0,0,0,0,1,0,0,0,0,1,0,-280,0,-300,1
server.js (5.2 KB)
client.js (7.8 KB)
bitbox.js (7.9 KB)
Edit: Found the solution here Every instances in InstancedMesh go to same position? - #3 by RemiTurcotte