I'm looking at the code in three.js, specifically the THREE.SphereGeometry method to create a sphere: https://github.com/mrdoob/three.js/blob/master/src/extras/geometries/SphereGeometry.js
There are 2 sets of loops - I'm looking at the second one.
My question is this: There's an array of arrays that's created, called vertices. Into this array are added arrays of objects.
Later, a single object is retrieved using indices, specifically:
var v1 = vertices[ y ][ x + 1 ];
Then, just below this, it appears the object is again referenced but by this syntax:
var n1 = this.vertices[ v1 ].clone().normalize();
Try as I may, this seems like a bug to me .. wouldn't this.vertices[v1] return undefined?