Skip to content

Commit 60cc510

Browse files
James WitteJames Witte
authored andcommitted
starting grid work
1 parent 98f76e5 commit 60cc510

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

js/secrets.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,44 @@ for (var k = 2; k < 44; k++) {
2929
}
3030
// two.add(group)
3131

32+
// Setup the canvas
33+
var two = new Two({
34+
fullscreen: true,
35+
autostart: true
36+
}).appendTo(document.body);;
37+
38+
var background = two.makeRectangle(two.width / 2, two.height / 2,
39+
two.width, two.height);
40+
background.noStroke();
41+
background.fill = 'black';
42+
background.name = 'background';
43+
44+
var container = two.makeGroup(background);
45+
46+
var rows = Math.floor(two.height / 100);
47+
var cols = Math.floor(two.width / 100);
48+
var width = Math.round(two.height / Math.max(rows, cols));
49+
var height = width;
50+
51+
for (var r = 0; r < rows; r++) {
52+
// even rows have an offset of 0.5
53+
var even = = !!(r % 2);
54+
var vi = r / (rows - 1);
55+
for (var c = 0; c < cols; c++) {
56+
var k = c;
57+
if (even) {
58+
k += 0.5;
59+
// we skip the final col on even rows to avoid overflow
60+
if (c < cols - 1) {
61+
var hi = k /(cols - 1);
62+
63+
}
64+
}
65+
}
66+
}
67+
68+
two.update();
69+
3270
function roseMath(v, k, t) {
3371
v.x = radius * Math.cos(k * t) * Math.cos(t);
3472
v.y = radius * Math.cos(k * t) * Math.sin(t);

0 commit comments

Comments
 (0)