diff --git a/hayfever/hayfever.scm b/hayfever/hayfever.scm index 6dab3a4..39fe1c3 100644 --- a/hayfever/hayfever.scm +++ b/hayfever/hayfever.scm @@ -94,7 +94,7 @@ (cond ((null? children) (let ((root (with-state - (translate (vector 0 0.5 0)) + (translate (vector 0 0.5 (* 0.1 (rndf)))) (rotate (vector 0 0 180)) (texture (load-texture (string-append "textures/comp-" id ".png"))) (build-plane)))) @@ -102,7 +102,7 @@ (else (let* ((connection-list (get-connection-list id)) (root (with-state - (translate (vector 0 0.5 (* 0.1 (rndf)))) + (translate (vector 0 0.5 (* 0.01 (rndf)))) (rotate (vector 0 0 180)) (texture (load-texture (string-append "textures/comp-" id ".png"))) (build-plane))) @@ -111,7 +111,7 @@ (lambda (child connection) (with-state (parent root) - (translate (vadd connection (vector 0 0 (* 0.1 (rndf))))) + (translate (vadd connection (vector 0 0 (* 0.01 (rndf))))) (rotate (vector 0 0 (2dvec->angle (vx connection) (- (vy connection) 0.5)))) (rotate (vector 0 0 0)) @@ -182,15 +182,14 @@ (define/public (init) (set! pollen (with-state - (translate (vector 0 0 0.1)) + (translate (vector 0 0 0.2)) (texture (load-texture "textures/pollen.png")) - (build-particles 300))) + (build-particles 1000))) (with-primitive pollen - (hint-depth-sort) (pdata-map! (lambda (p) - (vmul (vector (crndf) (crndf) 0) 10)) + (vmul (vector (crndf) (crndf) (+ 0.2 (* (rndf) 0.01))) 10)) "p") (pdata-map! (lambda (c) @@ -204,25 +203,25 @@ #;(set! root (with-state - (rotate (vector 90 0 0)) + + (rotate (vector 90 0 0)) (scale 100) (build-plane))) - #;(with-state - (hint-depth-sort) + (with-state ; (parent root) (with-state - (colour 0.5) + (colour (vector 0.5 1 0.5)) (scale (vector 20 13 1)) - (translate (vector 0 0.4 0)) + (translate (vector 0 0.2 0)) (rotate (vector 0 0 180)) - (texture (load-texture "textures/bg.png")) +; (texture (load-texture "textures/hills.png")) (hint-unlit) (build-plane)) - (with-state - (scale (vector 19 5 1)) - (translate (vector 0 0.2 1.5)) + #;(with-state + (scale (vector 14 15 1)) + (translate (vector 0 0.3 4.5)) (rotate (vector 0 0 180)) - (texture (load-texture "textures/mid.png")) + (texture (load-texture "textures/fg.png")) (hint-unlit) (build-plane)))) @@ -233,8 +232,8 @@ my-id) (define/public (make-my-plant) - (let* ((pos (vector (* (crndf) 5) 2 1)) - (col (hsv->rgb (vector (rndf) 0.5 1))) + (let* ((pos (vector (* (crndf) 5) 2 0.1)) + (col (hsv->rgb (vector (rndf) 0.8 1))) (desc (list (make-random-plant 0)))) (set! my-id (length entity-list)) (set-entity my-id (make-object plant% pos col desc)))) @@ -305,7 +304,8 @@ (for ((i (in-range 0 np))) (let ((c (random (pdata-size))) (cc (vmul col 1))) - (pdata-set! "p" c (vadd (vmul (cirndvec) size) pos)) + (pdata-set! "p" c (vadd (vmul (cirndvec) size) + (vadd pos (vector 0 0 (+ 0.2 (* (rndf) 0.01)))))) (pdata-set! "c" c (vector (vx cc) (vy cc) (vz cc) 0.5)))))) (define/public (suck-pollen pos size) @@ -368,7 +368,6 @@ (define/public (init) (with-state - (hint-depth-sort) ;(parent (send world get-root)) (colour col) (hint-unlit) @@ -433,7 +432,7 @@ (with-primitive (component-root (list-ref flower-list flower)) (get-global-transform))))) (send world puff-pollen pos (component-col (list-ref flower-list flower)) - 0.2 10))) + 0.2 1))) (define/public (suck world flower) (let ((pos (vtransform (vector 0 0 0) @@ -485,7 +484,7 @@ (stringify (eval-string (osc 7)))))) ((osc-msg "/flower") - (printf "flower change msg recieved~n") + ;(printf "flower change msg recieved~n") (send (send world get-entity (osc 0)) flower-update (osc 1) (vector (osc 2) (osc 3) (osc 4)))) @@ -548,7 +547,8 @@ ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (clear) -(clear-colour 0) +(clear-colour (vector 0.5 0.5 1)) +(hint-depth-sort) (set-camera-transform (mtranslate (vector 0 -5 -10))) (define w (make-object world% 1)) diff --git a/hayfever/textures/fg.png b/hayfever/textures/fg.png new file mode 100644 index 0000000..3e0faba Binary files /dev/null and b/hayfever/textures/fg.png differ diff --git a/hayfever/textures/grass.png b/hayfever/textures/grass.png new file mode 100644 index 0000000..99edc36 Binary files /dev/null and b/hayfever/textures/grass.png differ diff --git a/hayfever/textures/hills.png b/hayfever/textures/hills.png new file mode 100644 index 0000000..f8edd6b Binary files /dev/null and b/hayfever/textures/hills.png differ