I’m wondering if anyone else has run into the same problem and what the fixes are…
When I just use ‘scene.add(gltf.scene)’ to the GLTFLoader, the object renders fine:
Keep in mind that objects inherit the position/rotation/scale of their parents. If you traverse the scene, extract meshes or objects, and then add them directly to a parent scene, you’re removing them from their original parents and any position/rotation/scale that they received from those parents.
Here is my code: script.js (5.6 KB)
Lines 75 is where I traverse through the meshes
Thank you so much. Does this mean that I have to add the meshes to their parents before adding them to the scene? Also do you know why there are missing meshes?
In general it is not a good idea to modify a scene graph while you’re traversing it, you may miss things or reach them more than once. Adding objects to another parent modifies what you’re traversing, because it removes them from their original parent.
Would you be able to do call arduino.add( gltf.scene ) once, rather than adding all the parts separately?