Currently, I am attempting to populate an object-literal in Three.js with Object3D
s and then add meshes to each of those Object3D
s. However, I am encountering unexpected results when running my code. After isolating the issue, I have found that thing1 and thing2 do not receive any meshes, while thing3 ends up with all three meshes:
var objSet = {
thing1: new THREE.Object3D(),
thing2: new THREE.Object3D(),
thing3: new THREE.Object3D()
};
for (key in objSet) {
objSet[key].add(aMesh);
objSet[key].add(anotherMesh);
objSet[key].add(yetAnotherMesh);
};
My ultimate objective is to dynamically generate an object-literal containing Object3D
s and then consistently iterate through them to include meshes within each one. Can you help me identify where the issue lies? Thank you for your assistance!