some alpha transparency issues fixed
This commit is contained in:
parent
38aa608687
commit
6e0dd9a80e
4 changed files with 24 additions and 24 deletions
|
@ -94,7 +94,7 @@
|
||||||
(cond
|
(cond
|
||||||
((null? children)
|
((null? children)
|
||||||
(let ((root (with-state
|
(let ((root (with-state
|
||||||
(translate (vector 0 0.5 0))
|
(translate (vector 0 0.5 (* 0.1 (rndf))))
|
||||||
(rotate (vector 0 0 180))
|
(rotate (vector 0 0 180))
|
||||||
(texture (load-texture (string-append "textures/comp-" id ".png")))
|
(texture (load-texture (string-append "textures/comp-" id ".png")))
|
||||||
(build-plane))))
|
(build-plane))))
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
(else
|
(else
|
||||||
(let* ((connection-list (get-connection-list id))
|
(let* ((connection-list (get-connection-list id))
|
||||||
(root (with-state
|
(root (with-state
|
||||||
(translate (vector 0 0.5 (* 0.1 (rndf))))
|
(translate (vector 0 0.5 (* 0.01 (rndf))))
|
||||||
(rotate (vector 0 0 180))
|
(rotate (vector 0 0 180))
|
||||||
(texture (load-texture (string-append "textures/comp-" id ".png")))
|
(texture (load-texture (string-append "textures/comp-" id ".png")))
|
||||||
(build-plane)))
|
(build-plane)))
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
(lambda (child connection)
|
(lambda (child connection)
|
||||||
(with-state
|
(with-state
|
||||||
(parent root)
|
(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
|
(rotate (vector 0 0 (2dvec->angle
|
||||||
(vx connection) (- (vy connection) 0.5))))
|
(vx connection) (- (vy connection) 0.5))))
|
||||||
(rotate (vector 0 0 0))
|
(rotate (vector 0 0 0))
|
||||||
|
@ -182,15 +182,14 @@
|
||||||
(define/public (init)
|
(define/public (init)
|
||||||
|
|
||||||
(set! pollen (with-state
|
(set! pollen (with-state
|
||||||
(translate (vector 0 0 0.1))
|
(translate (vector 0 0 0.2))
|
||||||
(texture (load-texture "textures/pollen.png"))
|
(texture (load-texture "textures/pollen.png"))
|
||||||
(build-particles 300)))
|
(build-particles 1000)))
|
||||||
|
|
||||||
(with-primitive pollen
|
(with-primitive pollen
|
||||||
(hint-depth-sort)
|
|
||||||
(pdata-map!
|
(pdata-map!
|
||||||
(lambda (p)
|
(lambda (p)
|
||||||
(vmul (vector (crndf) (crndf) 0) 10))
|
(vmul (vector (crndf) (crndf) (+ 0.2 (* (rndf) 0.01))) 10))
|
||||||
"p")
|
"p")
|
||||||
(pdata-map!
|
(pdata-map!
|
||||||
(lambda (c)
|
(lambda (c)
|
||||||
|
@ -204,25 +203,25 @@
|
||||||
|
|
||||||
|
|
||||||
#;(set! root (with-state
|
#;(set! root (with-state
|
||||||
(rotate (vector 90 0 0))
|
|
||||||
|
(rotate (vector 90 0 0))
|
||||||
(scale 100)
|
(scale 100)
|
||||||
(build-plane)))
|
(build-plane)))
|
||||||
#;(with-state
|
(with-state
|
||||||
(hint-depth-sort)
|
|
||||||
; (parent root)
|
; (parent root)
|
||||||
(with-state
|
(with-state
|
||||||
(colour 0.5)
|
(colour (vector 0.5 1 0.5))
|
||||||
(scale (vector 20 13 1))
|
(scale (vector 20 13 1))
|
||||||
(translate (vector 0 0.4 0))
|
(translate (vector 0 0.2 0))
|
||||||
(rotate (vector 0 0 180))
|
(rotate (vector 0 0 180))
|
||||||
(texture (load-texture "textures/bg.png"))
|
; (texture (load-texture "textures/hills.png"))
|
||||||
(hint-unlit)
|
(hint-unlit)
|
||||||
(build-plane))
|
(build-plane))
|
||||||
(with-state
|
#;(with-state
|
||||||
(scale (vector 19 5 1))
|
(scale (vector 14 15 1))
|
||||||
(translate (vector 0 0.2 1.5))
|
(translate (vector 0 0.3 4.5))
|
||||||
(rotate (vector 0 0 180))
|
(rotate (vector 0 0 180))
|
||||||
(texture (load-texture "textures/mid.png"))
|
(texture (load-texture "textures/fg.png"))
|
||||||
(hint-unlit)
|
(hint-unlit)
|
||||||
(build-plane))))
|
(build-plane))))
|
||||||
|
|
||||||
|
@ -233,8 +232,8 @@
|
||||||
my-id)
|
my-id)
|
||||||
|
|
||||||
(define/public (make-my-plant)
|
(define/public (make-my-plant)
|
||||||
(let* ((pos (vector (* (crndf) 5) 2 1))
|
(let* ((pos (vector (* (crndf) 5) 2 0.1))
|
||||||
(col (hsv->rgb (vector (rndf) 0.5 1)))
|
(col (hsv->rgb (vector (rndf) 0.8 1)))
|
||||||
(desc (list (make-random-plant 0))))
|
(desc (list (make-random-plant 0))))
|
||||||
(set! my-id (length entity-list))
|
(set! my-id (length entity-list))
|
||||||
(set-entity my-id (make-object plant% pos col desc))))
|
(set-entity my-id (make-object plant% pos col desc))))
|
||||||
|
@ -305,7 +304,8 @@
|
||||||
(for ((i (in-range 0 np)))
|
(for ((i (in-range 0 np)))
|
||||||
(let ((c (random (pdata-size)))
|
(let ((c (random (pdata-size)))
|
||||||
(cc (vmul col 1)))
|
(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))))))
|
(pdata-set! "c" c (vector (vx cc) (vy cc) (vz cc) 0.5))))))
|
||||||
|
|
||||||
(define/public (suck-pollen pos size)
|
(define/public (suck-pollen pos size)
|
||||||
|
@ -368,7 +368,6 @@
|
||||||
|
|
||||||
(define/public (init)
|
(define/public (init)
|
||||||
(with-state
|
(with-state
|
||||||
(hint-depth-sort)
|
|
||||||
;(parent (send world get-root))
|
;(parent (send world get-root))
|
||||||
(colour col)
|
(colour col)
|
||||||
(hint-unlit)
|
(hint-unlit)
|
||||||
|
@ -433,7 +432,7 @@
|
||||||
(with-primitive (component-root (list-ref flower-list flower))
|
(with-primitive (component-root (list-ref flower-list flower))
|
||||||
(get-global-transform)))))
|
(get-global-transform)))))
|
||||||
(send world puff-pollen pos (component-col (list-ref flower-list flower))
|
(send world puff-pollen pos (component-col (list-ref flower-list flower))
|
||||||
0.2 10)))
|
0.2 1)))
|
||||||
|
|
||||||
(define/public (suck world flower)
|
(define/public (suck world flower)
|
||||||
(let ((pos (vtransform (vector 0 0 0)
|
(let ((pos (vtransform (vector 0 0 0)
|
||||||
|
@ -485,7 +484,7 @@
|
||||||
(stringify (eval-string (osc 7))))))
|
(stringify (eval-string (osc 7))))))
|
||||||
|
|
||||||
((osc-msg "/flower")
|
((osc-msg "/flower")
|
||||||
(printf "flower change msg recieved~n")
|
;(printf "flower change msg recieved~n")
|
||||||
(send (send world get-entity (osc 0)) flower-update
|
(send (send world get-entity (osc 0)) flower-update
|
||||||
(osc 1) (vector (osc 2) (osc 3) (osc 4))))
|
(osc 1) (vector (osc 2) (osc 3) (osc 4))))
|
||||||
|
|
||||||
|
@ -548,7 +547,8 @@
|
||||||
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
(clear)
|
(clear)
|
||||||
(clear-colour 0)
|
(clear-colour (vector 0.5 0.5 1))
|
||||||
|
(hint-depth-sort)
|
||||||
(set-camera-transform (mtranslate (vector 0 -5 -10)))
|
(set-camera-transform (mtranslate (vector 0 -5 -10)))
|
||||||
|
|
||||||
(define w (make-object world% 1))
|
(define w (make-object world% 1))
|
||||||
|
|
BIN
hayfever/textures/fg.png
Normal file
BIN
hayfever/textures/fg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
BIN
hayfever/textures/grass.png
Normal file
BIN
hayfever/textures/grass.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 183 KiB |
BIN
hayfever/textures/hills.png
Normal file
BIN
hayfever/textures/hills.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Loading…
Reference in a new issue