some alpha transparency issues fixed

This commit is contained in:
Dave Griffiths 2009-03-13 17:29:32 +00:00
parent 38aa608687
commit 6e0dd9a80e
4 changed files with 24 additions and 24 deletions

View file

@ -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))

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

BIN
hayfever/textures/hills.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB