commit 7fded1ce1ec8a396f945c7b9504ca49d41962217
parent c9e616badbfdcdeaeacc32e5507eb087dd8cc76f
Author: tongong <tongong@gmx.net>
Date: Sat, 17 Aug 2019 07:07:58 +0200
horizon relative to size
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/scripts/main.js b/scripts/main.js
@@ -1,5 +1,5 @@
-const HEIGHT = window.innerHeight;
-const WIDTH = window.innerWidth;
+var HEIGHT = window.innerHeight;
+var WIDTH = window.innerWidth;
var CENTER_HORIZON;
var LEFT_HORIZON;
var CENTER;
@@ -19,11 +19,13 @@ var startMillis;
const time = () => (typeof(startMillis) == "undefined") ? 0 : millis() - startMillis;
function setup() {
- CENTER = createVector(WIDTH / 2, HEIGHT / 2);
- CENTER_HORIZON = createVector(0, 0);
- LEFT_HORIZON = createVector(-CENTER.x, 0);
SIZE = min([HEIGHT / 3, WIDTH / 2 - 70, 500]);
ANGLE = SIZE * 1.5;
+
+ CENTER = createVector(WIDTH / 2, HEIGHT / 2);
+ CENTER_HORIZON = createVector(0, 0);
+ LEFT_HORIZON = createVector(-2 * SIZE, 0);
+
console.log(SIZE);
createCanvas(WIDTH, HEIGHT);
stroke(255);