diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-12-10 23:53:44 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-12-10 23:53:44 +0530 |
| commit | 4d0e55fb1d90300db5236d4e3b4f6c585f898b9d (patch) | |
| tree | 5b64d112012dd5662bc5d07ad6cf44cb4ea746d1 | |
| parent | 7cdf768a593b0f635e287a58bdcd35c43ba7ce5c (diff) | |
| download | creative-coding-playground-4d0e55fb1d90300db5236d4e3b4f6c585f898b9d.tar.gz creative-coding-playground-4d0e55fb1d90300db5236d4e3b4f6c585f898b9d.zip | |
| -rw-r--r-- | sketches/05/dragon.rkt | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/sketches/05/dragon.rkt b/sketches/05/dragon.rkt index 9cca295..25dd1c3 100644 --- a/sketches/05/dragon.rkt +++ b/sketches/05/dragon.rkt @@ -1,12 +1,21 @@ #lang sketching (define (setup) - (size 200 200) - (frame-rate 1) - (loop)) + (size 1920 1080) + (fullscreen) + (smoothing 'smoothed) + (no-cursor) + ;; (frame-rate 1) + ;; (loop) + (no-loop) + ) +;; Config (define iterations 14) -(define init-segment 400) +(define init-segment 900) + +;; State +(define current-iteration 19) (define Line cons) (define ->0 car) @@ -43,18 +52,20 @@ (dragon-curve (->0 lines) 1 (- iteration 1)) (dragon-curve (->1 lines) -1 (- iteration 1)))))) -(define current-iteration 0) (define (draw) - (background 150) + (background 21 18 31) + (stroke-weight 1) + (stroke-cap 'round) + (stroke-join 'round) + (stroke 50 39 99) (let* [ - (p1 (Point (- (/ width 2) (/ init-segment 2)) (/ height 2))) + (p1 (Point (- (/ width 2) (/ init-segment 2.38)) (- (/ height 2) (/ init-segment 6) ) )) (l1 (Line p1 (Point (+ (->x p1) init-segment) (->y p1)))) - (lines (dragon-curve l1 1 current-iteration)) ] - (stroke-weight 2) - (stroke 0 0 0) - (for-each draw/line lines) - (if (= current-iteration iterations) - (no-loop) - (set! current-iteration (+ current-iteration 1))))) + (for-each draw/line (dragon-curve l1 1 current-iteration))) + + ;; (if (= current-iteration iterations) + ;; (no-loop) + ;; (set! current-iteration (+ current-iteration 1))) + ) |
