I am generating a bunch of spheres using three.js through an array and a for loop. The original array looks like:
atoms = [
['Na', [0, 0, 0]],
['Na', [0.5, 0.5, 0]],
['Na', [0.5, 0, 0.5]],
['Na', [0, 0.5, 0.5]],
['Cl', [0.5, 0, 0]],
['Cl', [0, 0.5, 0]],
['Cl', [0, 0, 0.5]],
['Cl', [0.5, 0.5, 0.5]],
];
And i parse the data so that the 3 numbers represent the x, y, z coordinate.
The end product is controlled by orbitcontrols.js and looks like:
What I was wondering is how would I go about doing this: mouse over a sphere (while pressing a certain key as to not interfere with orbitcontrols) then upon a mouse click return the xyz of the sphere i clicked on.