From 83fe617a787a31abb19d0e58f4b39b41cb9ff1ad Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 7 Apr 2024 21:06:36 +0200 Subject: Cantor and more hihi --- bruijn/Experiments.bruijn | 7 +++++++ bruijn/Screen.bruijn | 1 + canvasWorker.js | 2 +- index.html | 37 +++++++++++++++++-------------------- main.js | 26 ++++++++------------------ style.css | 20 ++++++++++++++------ 6 files changed, 48 insertions(+), 45 deletions(-) diff --git a/bruijn/Experiments.bruijn b/bruijn/Experiments.bruijn index d1bc116..6b837c6 100644 --- a/bruijn/Experiments.bruijn +++ b/bruijn/Experiments.bruijn @@ -9,6 +9,7 @@ t-square-1 [[build tl tr bl br] mut] bl ^(~(~0)) br ^(~(~(~0))) +# TODO: 1/2 t-square-2 [[build tl tr bl br] mut] mut y* ([[[[build 3 2 1 (build b w w b)]]]] : ([[[[build 3 2 (build w b b w) 0]]]] : ([[[[build 3 (build w b b w) 1 0]]]] : {}[[[[build (build b w w b) 2 1 0]]]]))) tl ^0 @@ -24,3 +25,9 @@ sierpinski-carpet [[build tl tr bl br] mut] br ^(~(~(~0))) sierpinski-triangle [y [build 0 b 0 0]] + +cantor-dust [y [build tl tr bl br]] + tl [[0 1 1 1 1]] (build 0 b b b) + tr [[0 1 1 1 1]] (build b 0 b b) + bl [[0 1 1 1 1]] (build b b 0 b) + br [[0 1 1 1 1]] (build b b b 0) diff --git a/bruijn/Screen.bruijn b/bruijn/Screen.bruijn index 465df25..5100aa9 100644 --- a/bruijn/Screen.bruijn +++ b/bruijn/Screen.bruijn @@ -75,6 +75,7 @@ map [&[[[[[0 (5 4) (5 3) (5 2) (5 1)]]]]]] :test (map invert empty) (build w w w w) +# splits single pixel to quadrant of same color qsplit map [w? 0 (build w w w w) (build b b b b)] :test (qsplit (build b w b w)) (build (build b b b b) (build w w w w) (build b b b b) (build w w w w)) diff --git a/canvasWorker.js b/canvasWorker.js index a869810..0f17547 100644 --- a/canvasWorker.js +++ b/canvasWorker.js @@ -28,7 +28,7 @@ const initGL = () => { attribute vec2 a_position; uniform vec2 u_resolution; void main() { - vec2 inverted = vec2(a_position.x, u_resolution.y - a_position.y - 1.0); // !! :) + vec2 inverted = vec2(a_position.x, u_resolution.y - a_position.y); // !! :) vec2 zeroToOne = inverted / u_resolution; vec2 zeroToTwo = zeroToOne * 2.0; vec2 clipSpace = zeroToTwo - 1.0; diff --git a/index.html b/index.html index 78684b5..40f7a26 100644 --- a/index.html +++ b/index.html @@ -9,17 +9,6 @@