(theta, phi)
| 215 | var stacks = options.stacks || 8; |
| 216 | var polygons = [], vertices; |
| 217 | function vertex(theta, phi) { |
| 218 | theta *= Math.PI * 2; |
| 219 | phi *= Math.PI; |
| 220 | var dir = new CSG.Vector( |
| 221 | Math.cos(theta) * Math.sin(phi), |
| 222 | Math.cos(phi), |
| 223 | Math.sin(theta) * Math.sin(phi) |
| 224 | ); |
| 225 | vertices.push(new CSG.Vertex(c.plus(dir.times(r)), dir)); |
| 226 | } |
| 227 | for (var i = 0; i < slices; i++) { |
| 228 | for (var j = 0; j < stacks; j++) { |
| 229 | vertices = []; |