Skip to content

Commit

Permalink
now sphere is, actually, a sphere
Browse files Browse the repository at this point in the history
  • Loading branch information
cscheid committed Dec 20, 2014
1 parent e896ed1 commit 65a6d42
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions lux.js
Expand Up @@ -21221,23 +21221,23 @@ Lux.Models.sphere = function(latSecs, longSecs) {
var i, j, phi, theta;
for (i=0; i<=latSecs; ++i) {
phi = (i / latSecs);
for (j=0; j<longSecs; ++j) {
for (j=0; j<=longSecs; ++j) {
theta = (j / longSecs);
verts.push(theta, phi);
}
}
for (i=0; i<latSecs; ++i) {
for (j=0; j<longSecs; ++j) {
var thisX = j;
var nextX = (j+1) % longSecs;
var nextX = j+1;
var thisY = i;
var nextY = i+1;
elements.push(thisY * longSecs + thisX,
thisY * longSecs + nextX,
nextY * longSecs + thisX,
thisY * longSecs + nextX,
nextY * longSecs + nextX,
nextY * longSecs + thisX);
elements.push(thisY * (longSecs + 1) + thisX,
thisY * (longSecs + 1) + nextX,
nextY * (longSecs + 1) + thisX,
thisY * (longSecs + 1) + nextX,
nextY * (longSecs + 1) + nextX,
nextY * (longSecs + 1) + thisX);
}
}

Expand Down

0 comments on commit 65a6d42

Please sign in to comment.