There is a piece of code that creates an array of THREE.Mesh objects (Three.js)
this.multipleChoice = function(n){ console.log('log'); //проверка editor.ray.setFromCamera(editor.mouse, editor.camera); editor.intersects = editor.ray.intersectObjects(editor.cubes.children); //модель в зоне мышки? if(editor.intersects.length > 0){ editor.MINTERSECTED[n] = editor.intersects[0].object; //объект присваивается опр. ячейке массива } else editor.mN--; console.log(editor.MINTERSECTED); //тест } But instead
Array [2]
0: THREE.Mesh (many parameters in objects are different)
1: THREE.Mesh
length: 2
...
Occurs in the console this:
Array [2]
1: THREE.Mesh
length: 2
...
(When entered into the console, editor.MINTERSECTED [0] displays undefined)
Can you help?
console.log(n);- zero there, most likely, will not appear. - Igorconsole.log(n);insideif- Igor