I'm facing a challenge in storing customPrimitive entities within a group. The issue is that the entity generates its geometry internally by loading a file, so I only need to store the node itself. Below is my code snippet:
var grp = new THREE.Group();
this.el.sceneEl.object3D.add(grp);
for (let i = 0; i < 2; i++) {
let x = document.createElement('a-foo');
this.el.sceneEl.appendChild(x); // Works, but not ideal
// grp.appendChild(x); // grp.appendChild is not a function
// grp.add(x.object3D) // Attempting to add an element without `object3D`
// grp.add(x); // -^
}
Any suggestions on how to achieve this? You can also find the Fiddle here: https://jsfiddle.net/zrept6wf/2/