mirror of
https://github.com/KevinMidboe/cubewaves.git
synced 2025-10-29 17:40:17 +00:00
Change size of canvas and width of boxes.
This commit is contained in:
@@ -1,21 +1,23 @@
|
|||||||
let angle = 0;
|
let angle = 0;
|
||||||
let w = 24;
|
let w = 40;
|
||||||
let ma;
|
let ma;
|
||||||
let maxD;
|
let maxD;
|
||||||
|
|
||||||
function setup() {
|
function setup() {
|
||||||
createCanvas(400, 400, WEBGL);
|
createCanvas(600, 600, WEBGL);
|
||||||
ma = atan(1 / sqrt(2))
|
ma = atan(1 / sqrt(2))
|
||||||
maxD = dist(0, 0, 200, 200);
|
maxD = dist(0, 0, 200, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
background(100);
|
background(220);
|
||||||
ortho(-400, 400, 400, -400, 0, 600);
|
ortho(-700, 700, 700, -700, 0, 1200);
|
||||||
|
|
||||||
rotateX(-QUARTER_PI);
|
rotateX(-QUARTER_PI);
|
||||||
rotateY(ma);
|
rotateY(ma);
|
||||||
|
|
||||||
|
rectMode(CENTER);
|
||||||
|
|
||||||
let offset = 0;
|
let offset = 0;
|
||||||
for (let z = 0; z < height; z += w) {
|
for (let z = 0; z < height; z += w) {
|
||||||
for (let x = 0; x < width; x += w) {
|
for (let x = 0; x < width; x += w) {
|
||||||
@@ -27,7 +29,6 @@ function draw() {
|
|||||||
translate(x - width / 2, 0, z - height / 2);
|
translate(x - width / 2, 0, z - height / 2);
|
||||||
normalMaterial();
|
normalMaterial();
|
||||||
box(w - 2, h, w - 2);
|
box(w - 2, h, w - 2);
|
||||||
//rect(x - width / 2 + w / 2, 0, w - 2, h);
|
|
||||||
pop();
|
pop();
|
||||||
}
|
}
|
||||||
offset += 0.1;
|
offset += 0.1;
|
||||||
|
|||||||
Reference in New Issue
Block a user