I've been working on the code below:
const toothLoader = new THREE.OBJLoader();
let xPos = -80;
let yPos= 15;
let teethCount=0;
toothLoader.addEventListener( 'load', function ( event ) {
const object = event.content;
teeth.push(object);
});
toothLoader.load( 'obj/tooth1.obj' );
toothLoader.load('obj/tooth2.obj');
for(let i = 0; i<32; i++)
{
teeth[i].position.x=xPos;
teeth[i].position.y=yPos;
scene.add(teeth[i]);
}
Strangely, the for loop only seems to work when I set a breakpoint on its statements. Any ideas?