added the 3d stuff

This commit is contained in:
Dave Griffiths 2009-04-06 21:15:28 +01:00
parent 94abe40b9e
commit bc8cf6d953
20 changed files with 7998 additions and 4 deletions

View file

@ -3,6 +3,7 @@
;; exmaple chat client ;; exmaple chat client
(require "xmpp.scm") (require "xmpp.scm")
(require openssl)
(define (read-input prompt) (define (read-input prompt)
(display prompt) (display prompt)

Binary file not shown.

View file

@ -65,7 +65,7 @@
(map (map
(lambda (cp) (lambda (cp)
(vector (- (- (/ (vx cp) (pixels-width)) 0.5)) (vector (- (- (/ (vx cp) (pixels-width)) 0.5))
(- 1 (/ (vy cp) (pixels-height))) 0)) (/ (vy cp) (pixels-height)) 0))
l)) l))
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -102,7 +102,7 @@
(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.01 (rndf)))) (translate (vector 0 0.5 (* 0.01 (rndf))))
h (texture (load-texture (string-append "textures/comp-" id ".png"))) (texture (load-texture (string-append "textures/comp-" id ".png")))
(build-plane))) (build-plane)))
(comp (make-component root col (comp (make-component root col
(map (map
@ -399,7 +399,8 @@ h (texture (load-texture (string-append "textures/com
(let ((colours (suck world current-flower))) (let ((colours (suck world current-flower)))
(when (not (zero? (length colours))) (when (not (zero? (length colours)))
(let (let
((av-col (vdiv (foldl vadd (vector 0 0 0) colours) (length colours)))) ((av-col (vdiv (foldl (lambda (c1 c2)
(vadd c1 c2)) (vector 0 0 0) colours) (length colours))))
(set-component-col! flower (set-component-col! flower
(vadd (vmul (component-col flower) 0.9) (vadd (vmul (component-col flower) 0.9)

666
hayfever/hayfever2.scm Normal file
View file

@ -0,0 +1,666 @@
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(require scheme/class)
(require mzlib/string)
(osc-destination "osc.udp://127.0.0.255:4001")
(osc-source "4002")
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; pixel primitive things for getting connection points
; converts a 2D vector into an angle, with some dodgy dave maths
(define (2dvec->angle x y)
(let ((q (/ 3.141 2)))
(when (zero? y) (set! y 0.0001))
(cond
((>= y 0)
(fmod (* (+ q q q (- q (atan (/ x y)))) 57.2957795) 360))
(else
(fmod (* (+ q (- q (atan (/ x y)))) 57.2957795) 360)))))
(define (i->pos i)
(vector (modulo i (pixels-width))
(quotient i (pixels-width)) 0))
(define (pos->i pos)
(+ (* (round (vy pos)) (pixels-width)) (round (vx pos))))
(define (pixels-ref name pos)
(pdata-ref name (pos->i pos)))
(define (pixels-set! name pos s)
(pdata-set! name (pos->i pos) s))
(define (search i)
(cond
((eq? i (pdata-size)) i)
((< (vr (pdata-ref "c" i)) 0.5) i)
(else (search (+ i 1)))))
(define (flood pos tc av)
(define (rec-flood pos)
(pixels-set! "c" pos (vector 1 0 1))
(set! tc (+ tc 1))
(set! av (vadd av pos))
(when (< (vr (pixels-ref "c" (vadd pos (vector -1 0 0)))) 0.5)
(rec-flood (vadd pos (vector -1 0 0))))
(when (< (vr (pixels-ref "c" (vadd pos (vector 1 0 0)))) 0.5)
(rec-flood (vadd pos (vector 1 0 0))))
(when (< (vr (pixels-ref "c" (vadd pos (vector 0 1 0)))) 0.5)
(rec-flood (vadd pos (vector 0 1 0))))
(when (< (vr (pixels-ref "c" (vadd pos (vector 0 -1 0)))) 0.5)
(rec-flood (vadd pos (vector 0 -1 0)))))
(rec-flood pos)
(vmul av (/ 1 tc)))
(define (find-centroids pos l)
(let ((i (search pos)))
(cond ((eq? i (pdata-size)) l)
(else
(find-centroids i
(cons (flood (i->pos i) 0 (vector 0 0 0)) l))))))
(define (convert-to-pos l)
(map
(lambda (cp)
(vector (- (- (/ (vx cp) (pixels-width)) 0.5))
(/ (vy cp) (pixels-height)) 0))
l))
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; a cache for the connection points - should save this out
(define connection-cache '())
(define (get-connection-list id)
(let ((ret (assoc id connection-cache)))
(cond
(ret (cdr ret))
(else
(let* ((tex (load-primitive (string-append "textures/comp-cp-" id ".png")))
(connections (with-primitive tex (convert-to-pos (find-centroids 0 '())))))
(set! connection-cache (cons (cons id connections) connection-cache))
(destroy tex)
connections)))))
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; a plant component
(define-struct component (root (col #:mutable) children))
(define (build-component id col children)
(cond
((null? children)
(let ((root (with-state
(translate (vector 0 0.5 (* 0.1 (rndf))))
(hint-depth-sort)
(texture (load-texture (string-append "textures/comp-" id ".png")))
(build-plane))))
(make-component root col '())))
(else
(let* ((connection-list (get-connection-list id))
(root (with-state
(hint-depth-sort)
(translate (vector 0 0.5 (* 0.01 (rndf))))
; (rotate (vector 0 0 90))
(texture (load-texture (string-append "textures/comp-" id ".png")))
(build-plane)))
(comp (make-component root col
(map
(lambda (child connection)
(with-state
(parent root)
(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))
(build-component (car child) col (cadr child))))
children
connection-list))))
(with-primitive root (apply-transform))
comp))))
(define (random-leaf component)
(cond
((null? (component-children component)) component)
(else (random-leaf (choose (component-children component))))))
(define (component-leaves component)
(cond
((null? (component-children component)) (list component))
(else
(foldl
(lambda (child r)
(append (component-leaves child) r))
'()
(component-children component)))))
(define (component-print component)
(printf "~a~n" (component-children component)))
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; utils for building random plants
(define (choose l)
(list-ref l (random (length l))))
(define (make-random-plant depth)
(let ((num-children (cond ((> depth 2) 0)
((< depth 1) (choose (list 2 3)))
(else (choose (list 0 1 2 3))))))
(cond
((eq? num-children 0) (list (choose (list "11")) (list)))
((eq? num-children 1) (list "1-1" (list (make-random-plant (+ depth 1)))))
((eq? num-children 2) (list "2-1" (list (make-random-plant (+ depth 1))
(make-random-plant (+ depth 1)))))
((eq? num-children 3) (list "3-1" (list (make-random-plant (+ depth 1))
(make-random-plant (+ depth 1)) (make-random-plant (+ depth 1)))))
((eq? num-children 4) (list "4-1" (list (make-random-plant (+ depth 1))
(make-random-plant (+ depth 1)) (make-random-plant (+ depth 1))
(make-random-plant (+ depth 1)))))
((eq? num-children 5) (list "5-1" (list (make-random-plant (+ depth 1))
(make-random-plant (+ depth 1)) (make-random-plant (+ depth 1))
(make-random-plant (+ depth 1)) (make-random-plant (+ depth 1))))))))
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; the world things live in
(define world%
(class object%
(init-field (size 1))
(field
(root 0)
(entity-list '())
(id 0)
(pollen 0)
(my-id 0))
(define/public (init)
(set! pollen (with-state
(translate (vector 0 0 0.2))
(texture (load-texture "textures/pollen.png"))
(build-particles 1000)))
(with-primitive pollen
(pdata-map!
(lambda (p)
(vmul (vector (crndf) (crndf) (+ 0.2 (* (rndf) 0.01))) 10))
"p")
(pdata-map!
(lambda (c)
(vector (rndf) (rndf) (rndf) 0.5))
"c")
(pdata-map!
(lambda (c)
(let ((s (* 0.2 (grndf))))
(vector s s 1)))
"s"))
#;(set! root (with-state
(rotate (vector 90 0 0))
(scale 100)
(build-plane)))
#;(with-state
; (parent root)
(with-state
(colour (vector 0.5 1 0.5))
(scale (vector 20 13 1))
(translate (vector 0 0.2 0))
(rotate (vector 0 0 180))
; (texture (load-texture "textures/hills.png"))
(hint-unlit)
(build-plane))
#;(with-state
(scale (vector 14 15 1))
(translate (vector 0 0.3 4.5))
(rotate (vector 0 0 180))
(texture (load-texture "textures/fg.png"))
(hint-unlit)
(build-plane))))
(define/public (get-entity-list)
entity-list)
(define/public (get-my-id)
my-id)
(define/public (make-my-plant)
(let* ((pos (vector (* (crndf) 5) 0 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))))
(define/public (get-entity id)
(foldl
(lambda (entity ret)
(if (eq? (send entity get-id) id)
entity
ret))
#f
entity-list))
(define/public (choose)
(list-ref entity-list (random (length entity-list))))
(define/public (set-entity id entity)
; if it already exists, destroy it
; (do we want to do this all the time?)
(when (get-entity id)
(destroy-entity id))
(send entity set-id! id)
(set! entity-list (cons entity entity-list)))
(define/public (destroy-entity id)
(set! entity-list
(filter
(lambda (entity)
(cond ((eq? (send entity get-id) id)
(send entity destroy-me)
#f)
(else #t)))
entity-list)))
(define/public (update network)
(with-primitive pollen
(animate-pollen))
; update my plant with player input
(when (get-entity my-id)
(send (get-entity my-id) player-update this network))
(for-each
(lambda (entity)
(send entity update this))
entity-list))
; pollen stuff
(define (animate-pollen)
(pdata-map!
(lambda (p)
(let* ((pp (vmul p 0.5))
(v (vector (- (noise (vx pp) (vy pp) (time)) 0.5)
(- (noise (vx pp) (+ (vy pp) 112.3) (time)) 0.5) 0)))
(vadd (vadd p (vmul v 0.2))
(vmul (vector (crndf) (crndf) 0) 0.01))))
"p"))
(define (cirndvec)
(let ((o (srndvec)))
(vector (vx o) (vy o) 0)))
(define/public (puff-pollen pos col size np)
(with-primitive pollen
(for ((i (in-range 0 np)))
(let ((c (random (pdata-size)))
(cc (vmul col 1)))
(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)
(with-primitive pollen
(pdata-index-fold
(lambda (i p c r)
(cond ((< (vdist pos p) (/ size 10))
(pdata-set! "p" i (vector -1000 0 0))
(cons c r))
((< (vdist pos p) size)
(pdata-set! "p" i (vadd p
(vmul (vnormalise (vsub pos p)) 0.1)))
r)
(else r)))
'()
"p" "c")))
(super-new)
(init)))
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; the entity base class
(define entity%
(class object%
(init-field (id 0))
(define/public (get-id)
id)
(define/public (set-id! s)
(set! id s))
(super-new)))
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; finally, a plant...
(define plant%
(class entity%
(init-field
(pos (vector 0 0 0))
(col (vector 1 1 1))
(plant-desc '())
(flower-list '())
(current-flower 0))
(field
(root-component 0)
(spray-t 0))
(define/public (get-pos)
pos)
(define/public (get-col)
col)
(define/public (get-desc)
plant-desc)
(define/public (init)
(with-state
;(parent (send world get-root))
(colour col)
(hint-unlit)
(translate pos)
(printf "building from:~a~n" plant-desc)
(set! root-component (build-component "1-1" col plant-desc))
(set! flower-list (component-leaves root-component))))
(define/public (destroy-me)
(destroy (component-root root-component)))
(define/public (player-update world network)
(when (key-special-pressed 100)
(set! current-flower (modulo (+ current-flower 1) (length flower-list))))
(when (key-special-pressed 102)
(set! current-flower (modulo (- current-flower 1) (length flower-list))))
; bit odd, have to go through network to tell other clients to
; spray, and need to get the id of the player plant from the world...
(when (key-special-pressed 101)
(send network spray world (send world get-my-id) current-flower 0))
(let ((flower (list-ref flower-list current-flower)))
(with-primitive (component-root flower)
(when (key-special-pressed 103)
(rotate (vector 0 0 20))
(let ((colours (suck world current-flower)))
(when (not (zero? (length colours)))
(let
((av-col (vdiv (foldl (lambda (c1 c2)
(vadd c1 c2)) (vector 0 0 0) colours) (length colours))))
(set-component-col! flower
(vadd (vmul (component-col flower) 0.9)
(vmul av-col 0.1)))
(send network flower-update world (send world get-my-id)
current-flower (component-col flower))))))
(rotate (vector 0 0 2)))))
(define/public (flower-update flower col)
(let ((flower (list-ref flower-list flower)))
(set-component-col! flower col)
(with-primitive (component-root flower)
(colour (component-col flower)))))
(define/public (update world)
0
#;(with-primitive root
(colour col)
(when (> spray-t 1)
(set! spray-t (* spray-t 0.9))
(colour spray-t))))
(define/public (spray world flower type)
(let ((pos (vtransform (vector 0 0 0)
(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 1)))
(define/public (suck world flower)
(let ((pos (vtransform (vector 0 0 0)
(with-primitive (component-root (list-ref flower-list flower))
(get-global-transform)))))
(send world suck-pollen pos 5)))
(super-new)
(init)))
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(define network-dispatch%
(class object%
(field
(waiting #f)
(wait-till 0))
(define (stringify l)
(cond
((null? l) l)
((symbol? (car l))
(cons (symbol->string (car l))
(stringify (cdr l))))
((number? (car l))
(cons (number->string (car l))
(stringify (cdr l))))
((vector? (car l))
(cons (car l)
(stringify (cdr l))))
((list? (car l))
(cons (stringify (car l)) (stringify (cdr l))))
(else (error "oops"))))
(define (dispatch world)
(cond
((osc-msg "/join-game")
(printf "a new plant has joined the game~n")
; send a plant update for the new player
(update-plant world) )
((osc-msg "/plant")
(printf "add plant message recieved : ~a~n" (osc 0))
(send world set-entity (osc 0) (make-object plant%
(vector (osc 1) (osc 2) (osc 3))
(vector (osc 4) (osc 5) (osc 6))
(stringify (eval-string (osc 7))))))
((osc-msg "/flower")
;(printf "flower change msg recieved~n")
(send (send world get-entity (osc 0)) flower-update
(osc 1) (vector (osc 2) (osc 3) (osc 4))))
((osc-msg "/destroy-plant")
(printf "destroy plant message recieved...~n")
(send world destroy-entity (osc 0)))
((osc-msg "/spray")
; (printf "destroy plant message recieved...~n")
(let ((e (send world get-entity (osc 0))))
; it's possible to get spray events before the
; plant has been created...
(when e
(send e spray world (osc 1) (osc 2)))))))
(define/public (join-game world)
(printf "sending join-game~n")
(osc-send "/join-game" "" (list))
(set! wait-till (+ (time) 2))
(set! waiting #t))
(define/public (update-plant world)
(printf "sending /plant...~n")
(let* ((my-plant (send world get-entity (send world get-my-id)))
(pos (send my-plant get-pos))
(col (send my-plant get-col))
(desc-str (format "'~a" (send my-plant get-desc))))
(osc-send "/plant" "iffffffs" (list (send world get-my-id)
(vx pos) (vy pos) (vz pos)
(vx col) (vy col) (vz col)
desc-str))))
(define/public (destroy-plant world id)
(printf "sending destroy plant...~n")
(osc-send "/destroy-plant" "i" (list id))
(send world destroy-entity id))
(define/public (spray world id flower type)
(osc-send "/spray" "iii" (list id flower type))
(send (send world get-entity id) spray world flower type))
(define/public (flower-update world id flower col)
(osc-send "/flower" "iifff" (list id flower (vx col) (vy col) (vz col)))
(send (send world get-entity id) flower-update flower col))
(define/public (update world)
; wait for all other players to register their plants
(when (and waiting (< wait-till (time)))
(set! waiting #f)
(send world make-my-plant)
(update-plant world))
(dispatch world))
(super-new)))
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; things needed for the set
(define (build-shells obj count dist col)
(when (not (zero? count))
(with-state
(parent obj)
(colour col)
(let ((shell (build-copy obj)))
(with-primitive shell
(pdata-map!
(lambda (p n)
(vadd p (vmul (vector 0 1 0) dist)))
"p" "n"))
(build-shells shell (- count 1) dist (vmul col 1))))))
(define (build-shrub p n)
(with-state
(translate p)
(colour (vector 0.5 0.7 0.4))
(let ((shrub (build-ribbon (+ (random 10) 2))))
(with-primitive shrub
(pdata-index-map!
(lambda (i p)
(let ((j (* 0.2 (* i 0.2))))
(vector (* (crndf) j) (* i 0.2) (* (crndf) j))))
"p")
(pdata-index-map!
(lambda (i w)
(* (/ 1 (+ i 1)) 0.2))
"w")))))
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(clear)
(clear-texture-cache)
(clear-colour (vector 0 0 0))
(define l (make-light 'spot 'free))
(light-diffuse 0 (vector 0 0 0))
(light-diffuse l (vector 1 1 1))
(light-position l (vector 0 9 0))
(light-direction l (vector 0 -1 0))
(light-spot-angle l 55)
(light-spot-exponent l 1)
(define l2 (make-light 'point 'free))
(light-position l2 (vector 0 10 0))
(light-diffuse l2 (vector 0.4 0.5 0.9))
(with-state
(backfacecull 0)
(texture (load-texture "textures/car-base.png"))
(load-primitive "meshes/car.obj"))
(define terrain (with-state
(texture (load-texture "textures/ground-base.png"))
(load-primitive "meshes/ground.obj")))
;(define grassmap (load-primitive "textures/set-grass.png"))
(define (tx->pi tx)
(+ (vy tx) (* (vx tx) (pixels-width))))
(with-primitive terrain
(poly-for-each-tri-sample
(lambda (indices bary)
(let ((tc (vadd
(vmul (pdata-ref "t" (list-ref indices 0)) (vx bary))
(vmul (pdata-ref "t" (list-ref indices 1)) (vy bary))
(vmul (pdata-ref "t" (list-ref indices 2)) (vz bary)))))
(when #t #;(> (va (with-primitive grassmap (pdata-ref "c" (tx->pi tc)))) 0.5)
(build-shrub (vadd
(vmul (pdata-ref "p" (list-ref indices 0)) (vx bary))
(vmul (pdata-ref "p" (list-ref indices 1)) (vy bary))
(vmul (pdata-ref "p" (list-ref indices 2)) (vz bary))) (vector 0 1 0)))))
1))
(define shell0 (build-copy terrain))
(with-primitive shell0
(pdata-copy "t" "t1")
(pdata-map!
(lambda (t)
(vmul t 4))
"t"))
(with-state
(multitexture 0 (load-texture "textures/shell.png"))
(multitexture 1 (load-texture "textures/ground-grassmap2.png"))
(build-shells shell0 4 0.1 (vector 1 1 1)))
(define buildings (with-state
(backfacecull 0)
(texture (load-texture "textures/building-base.png"))
(load-primitive "meshes/buildings.obj")))
(with-state
(multitexture 0 (load-texture "textures/shell.png"))
(multitexture 1 (load-texture "textures/building-grassmap.png"))
(build-shells buildings 4 0.04 (vector 1 1 1)))
(hint-depth-sort)
(define w (make-object world% 1))
(define n (make-object network-dispatch%))
(send n join-game w)
(define (animate)
(send n update w)
(send w update n))
(every-frame (animate))

View file

@ -0,0 +1,12 @@
# Blender3D MTL File: set-2.blend
# Material Count: 1
newmtl None_building-base.png
Ns 0
Ka 0.000000 0.000000 0.000000
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2
map_Kd building-base.png

View file

@ -0,0 +1,836 @@
# Blender3D v245 OBJ File: set-2.blend
# www.blender3d.org
mtllib buildings.mtl
o Cube.001_Cube
v 10.568295 -0.726191 -7.363354
v 10.568295 -0.726192 -2.423897
v 8.568294 -0.726192 -2.423899
v 8.568295 -0.726192 -7.363352
v 10.568296 1.051739 -6.422636
v 10.568293 1.273808 -2.423893
v 8.568295 1.273808 -2.164847
v 8.568295 1.273808 -6.530418
v 8.568294 1.273806 -1.128821
v 8.568291 -0.726194 -1.128823
v 10.568291 1.273806 -1.128817
v 10.568293 -0.726194 -1.128821
v 9.887153 2.715447 -1.128815
v 8.568294 2.672285 -1.128818
v 10.568293 2.342384 -2.423891
v 8.568294 2.715450 -2.024298
v -5.248294 -0.756044 10.960698
v -10.178847 -0.756044 10.686761
v -10.120747 -0.756044 9.641026
v -5.190193 -0.756044 9.914964
v -6.766133 4.182114 10.876369
v -9.689278 4.111638 10.713960
v -10.120746 4.182114 9.641025
v -6.064506 4.182114 9.866387
v -11.006251 4.182114 9.591825
v -11.006252 -0.756044 9.591826
v -10.569792 4.182114 10.235881
v -11.064353 -0.756044 10.637561
v -10.066323 4.182114 8.661508
v -10.951829 4.182114 8.612309
v -10.951829 -0.756044 8.612309
v -10.066323 -0.756044 8.661508
v -10.066323 2.911450 8.661508
v -10.066323 4.198201 8.661508
v -10.951829 2.911450 8.612309
v -10.951829 4.198201 8.612309
v -9.925598 4.526523 6.128698
v -10.811104 4.198201 6.079499
v -10.811105 2.911450 6.079499
v -9.925598 2.911450 6.128698
v -9.833617 2.911450 4.473202
v -9.867198 4.198201 5.077632
v -10.724578 2.911450 4.522182
v -10.771517 4.198201 5.367021
v -9.807529 -0.590291 4.003661
v -10.693035 -0.590291 3.954462
v -10.811105 -0.590291 6.079500
v -9.925598 -0.590291 6.128698
v -13.131713 -0.533763 -8.983381
v -13.131713 -0.533763 -4.407258
v -14.209670 -0.533763 -4.407259
v -14.209670 -0.533763 -8.983382
v -13.131712 4.042361 -8.983381
v -13.131713 4.042361 -4.518392
v -14.209670 3.674810 -4.407259
v -14.209670 3.989019 -8.983382
v -14.209670 -0.533763 -10.089749
v -13.856647 4.042361 -9.787442
v -13.131713 -0.533763 -10.089748
v -13.131712 4.042361 -10.089747
v -10.723534 4.042361 -9.894854
v -10.948980 4.042361 -8.983381
v -10.723534 -0.533763 -10.089748
v -10.723534 -0.533763 -8.983381
v -10.723534 -0.568558 -8.983381
v -10.723533 2.701798 -8.983381
v -10.723534 -0.568558 -10.089748
v -10.723533 2.701798 -10.089747
v -10.128723 2.701791 -10.089747
v -9.811058 2.701791 -8.983381
v -9.811060 -0.568565 -10.089748
v -9.811060 -0.568565 -8.983381
v -9.811058 1.304780 -8.983381
v -9.811060 -0.574798 -8.983381
v -9.811060 -0.574798 -10.089748
v -9.811058 1.304780 -10.089747
v -8.173998 1.304751 -8.983381
v -8.139668 1.304751 -9.870808
v -7.773963 -0.574827 -10.089748
v -7.773963 -0.574827 -8.983381
v -13.131712 4.042362 -7.174145
v -14.209670 4.042362 -7.174145
v -14.209670 4.042361 -4.803533
v -13.131713 4.042361 -4.803531
v -13.364929 5.273930 -7.174145
v -13.131713 5.273930 -5.099784
v -14.209670 5.029894 -4.803533
v -14.209670 5.014520 -7.174145
vt 0.924118 0.972332 0.0
vt 0.924018 0.871925 0.0
vt 0.990761 0.871880 0.0
vt 0.924118 0.972332 0.0
vt 0.990761 0.871880 0.0
vt 0.982538 1.000000 0.0
vt 0.917383 0.825620 0.0
vt 0.917809 0.697545 0.0
vt 0.952081 0.798017 0.0
vt 0.917809 0.697545 0.0
vt 0.945126 0.697628 0.0
vt 0.952081 0.798017 0.0
vt 0.560014 0.730063 0.0
vt 0.559810 0.663885 0.0
vt 0.587384 0.729980 0.0
vt 0.559810 0.663885 0.0
vt 0.587613 0.663801 0.0
vt 0.587384 0.729980 0.0
vt 0.424390 0.939951 0.0
vt 0.424005 0.811880 0.0
vt 0.452192 0.939866 0.0
vt 0.424005 0.811880 0.0
vt 0.458754 0.811848 0.0
vt 0.452192 0.939866 0.0
vt 0.266098 0.394095 0.0
vt 0.959092 0.395644 0.0
vt 0.352750 0.757354 0.0
vt 0.959092 0.395644 0.0
vt 0.936808 0.767476 0.0
vt 0.352750 0.757354 0.0
vt 0.288061 0.586267 0.0
vt 0.288446 0.711233 0.0
vt 0.288290 0.660596 0.0
vt 0.288061 0.586267 0.0
vt 0.288290 0.660596 0.0
vt 0.288085 0.594248 0.0
vt 0.281942 0.586267 0.0
vt 0.278945 0.714403 0.0
vt 0.270828 0.586334 0.0
vt 0.278945 0.714403 0.0
vt 0.270917 0.714409 0.0
vt 0.270828 0.586334 0.0
vt 0.558668 0.780575 0.0
vt 0.549428 0.652855 0.0
vt 0.560014 0.730063 0.0
vt 0.549428 0.652855 0.0
vt 0.559810 0.663885 0.0
vt 0.560014 0.730063 0.0
vt 0.650902 0.542311 0.0
vt 0.650807 0.414227 0.0
vt 0.701750 0.414200 0.0
vt 0.650902 0.542311 0.0
vt 0.701750 0.414200 0.0
vt 0.701839 0.542275 0.0
vt 0.696212 0.770123 0.0
vt 0.696259 0.370450 0.0
vt 0.882008 0.757157 0.0
vt 0.696259 0.370450 0.0
vt 0.925069 0.355605 0.0
vt 0.882008 0.757157 0.0
vt 0.105829 0.736519 0.0
vt 0.142023 0.240829 0.0
vt 0.625248 0.779788 0.0
vt 0.142023 0.240829 0.0
vt 0.674742 0.210178 0.0
vt 0.625248 0.779788 0.0
vt 0.588605 0.414200 0.0
vt 0.619754 0.414295 0.0
vt 0.619007 0.656331 0.0
vt 0.588605 0.414200 0.0
vt 0.619007 0.656331 0.0
vt 0.587858 0.656236 0.0
vt 0.759429 0.108695 0.0
vt 0.812244 0.108534 0.0
vt 0.813192 0.307140 0.0
vt 0.759429 0.108695 0.0
vt 0.813192 0.307140 0.0
vt 0.760117 0.350729 0.0
vt 0.279109 0.843617 0.0
vt 0.289638 0.646185 0.0
vt 0.515291 0.628690 0.0
vt 0.279109 0.843617 0.0
vt 0.515291 0.628690 0.0
vt 0.477715 0.845979 0.0
vt 0.709684 0.974575 0.0
vt 0.476596 0.965308 0.0
vt 0.732855 0.641381 0.0
vt 0.476596 0.965308 0.0
vt 0.475597 0.641571 0.0
vt 0.732855 0.641381 0.0
vt 0.759604 0.108694 0.0
vt 0.851392 0.070671 0.0
vt 0.812244 0.108534 0.0
vt 0.759604 0.108694 0.0
vt 0.812244 0.108534 0.0
vt 0.759429 0.108695 0.0
vt 0.282118 0.586267 0.0
vt 0.282213 0.617152 0.0
vt 0.282038 0.617153 0.0
vt 0.282118 0.586267 0.0
vt 0.282038 0.617153 0.0
vt 0.281942 0.586268 0.0
vt 0.233516 0.242307 0.0
vt 0.141447 0.242027 0.0
vt 0.194187 0.242187 0.0
vt 0.141447 0.242027 0.0
vt 0.141271 0.242026 0.0
vt 0.194187 0.242187 0.0
vt 0.305783 0.145568 0.0
vt 0.319423 0.931969 0.0
vt 0.729049 0.918960 0.0
vt 0.305783 0.145568 0.0
vt 0.729049 0.918960 0.0
vt 0.737121 0.089909 0.0
vt 0.858535 0.589035 0.0
vt 0.889683 0.589130 0.0
vt 0.889349 0.697545 0.0
vt 0.858535 0.589035 0.0
vt 0.889349 0.697545 0.0
vt 0.858200 0.697450 0.0
vt 0.759296 0.000280 0.0
vt 0.851191 0.000000 0.0
vt 0.851392 0.070671 0.0
vt 0.759296 0.000280 0.0
vt 0.851392 0.070671 0.0
vt 0.759604 0.108694 0.0
vt 0.889683 0.589153 0.0
vt 0.920832 0.589131 0.0
vt 0.889732 0.659824 0.0
vt 0.920832 0.589131 0.0
vt 0.920907 0.697545 0.0
vt 0.889732 0.659824 0.0
vt 0.288068 1.041047 0.0
vt 0.061115 1.058961 0.0
vt 0.061622 0.743307 0.0
vt 0.288068 1.041047 0.0
vt 0.061622 0.743307 0.0
vt 0.316845 0.730653 0.0
vt 0.589264 0.663219 0.0
vt 0.619382 0.787866 0.0
vt 0.606761 0.752090 0.0
vt 0.589264 0.663219 0.0
vt 0.606761 0.752090 0.0
vt 0.589076 0.662263 0.0
vt 0.619754 0.657286 0.0
vt 0.589264 0.663219 0.0
vt 0.589076 0.662263 0.0
vt 0.619754 0.657286 0.0
vt 0.589076 0.662263 0.0
vt 0.619566 0.656331 0.0
vt 0.270828 0.377618 0.0
vt 0.142083 0.350440 0.0
vt 0.233173 0.350718 0.0
vt 0.142083 0.350440 0.0
vt 0.141103 0.350437 0.0
vt 0.233173 0.350718 0.0
vt 0.745817 0.084074 0.0
vt 0.757368 0.908847 0.0
vt 0.304144 0.101658 0.0
vt 0.757368 0.908847 0.0
vt 0.319335 0.925698 0.0
vt 0.304144 0.101658 0.0
vt 0.540189 0.128470 0.0
vt 0.571338 0.128565 0.0
vt 0.570455 0.414690 0.0
vt 0.540189 0.128470 0.0
vt 0.570455 0.414690 0.0
vt 0.539306 0.414595 0.0
vt 0.572097 0.128076 0.0
vt 0.700684 0.127684 0.0
vt 0.572912 0.414200 0.0
vt 0.700684 0.127684 0.0
vt 0.701839 0.413827 0.0
vt 0.572912 0.414200 0.0
vt 0.619754 0.542333 0.0
vt 0.650902 0.542311 0.0
vt 0.651082 0.801647 0.0
vt 0.619754 0.542333 0.0
vt 0.651082 0.801647 0.0
vt 0.625439 0.828451 0.0
vt 0.700684 0.127684 0.0
vt 0.572097 0.128076 0.0
vt 0.700968 0.041583 0.0
vt 0.572097 0.128076 0.0
vt 0.571733 0.000000 0.0
vt 0.700968 0.041583 0.0
vt 0.540189 0.128470 0.0
vt 0.540584 0.000393 0.0
vt 0.571338 0.128565 0.0
vt 0.540584 0.000393 0.0
vt 0.571733 0.000488 0.0
vt 0.571338 0.128565 0.0
vt 0.650807 0.414227 0.0
vt 0.650902 0.542311 0.0
vt 0.628205 0.456195 0.0
vt 0.650902 0.542311 0.0
vt 0.619754 0.542333 0.0
vt 0.628205 0.456195 0.0
vt 0.431335 0.780963 0.0
vt 0.558668 0.780575 0.0
vt 0.431430 0.811848 0.0
vt 0.558668 0.780575 0.0
vt 0.560249 0.806023 0.0
vt 0.431430 0.811848 0.0
vt 0.430940 0.653216 0.0
vt 0.549428 0.652855 0.0
vt 0.431335 0.780963 0.0
vt 0.549428 0.652855 0.0
vt 0.558668 0.780575 0.0
vt 0.431335 0.780963 0.0
vt 0.627773 0.326915 0.0
vt 0.631590 0.841202 0.0
vt 0.415066 0.817284 0.0
vt 0.627773 0.326915 0.0
vt 0.415066 0.817284 0.0
vt 0.414628 0.314543 0.0
vt 0.954908 0.089400 0.0
vt 0.939420 0.960069 0.0
vt 0.087043 0.942968 0.0
vt 0.954908 0.089400 0.0
vt 0.087043 0.942968 0.0
vt 0.081315 0.071874 0.0
vt 0.540189 0.128470 0.0
vt 0.411354 0.128077 0.0
vt 0.411749 0.000000 0.0
vt 0.540189 0.128470 0.0
vt 0.411749 0.000000 0.0
vt 0.540584 0.000393 0.0
vt 0.210745 0.980078 0.0
vt 0.210831 0.874857 0.0
vt 0.270828 0.888155 0.0
vt 0.210745 0.980078 0.0
vt 0.270828 0.888155 0.0
vt 0.270742 0.993375 0.0
vt 0.858200 0.592326 0.0
vt 0.857879 0.697545 0.0
vt 0.759296 0.697244 0.0
vt 0.858200 0.592326 0.0
vt 0.759296 0.697244 0.0
vt 0.759617 0.592025 0.0
vt 0.901999 0.726525 0.0
vt 0.644392 0.732142 0.0
vt 0.634410 0.198654 0.0
vt 0.901999 0.726525 0.0
vt 0.634410 0.198654 0.0
vt 0.965081 0.191445 0.0
vt 0.293013 0.593779 0.0
vt 0.100763 0.586697 0.0
vt 0.311082 0.168457 0.0
vt 0.100763 0.586697 0.0
vt 0.048748 0.158792 0.0
vt 0.311082 0.168457 0.0
vt 0.650391 0.984131 0.0
vt 0.439362 0.965457 0.0
vt 0.649087 0.434210 0.0
vt 0.439362 0.965457 0.0
vt 0.439318 0.416595 0.0
vt 0.649087 0.434210 0.0
vt 0.634213 0.403858 0.0
vt 0.815281 0.378766 0.0
vt 0.831343 0.901672 0.0
vt 0.634213 0.403858 0.0
vt 0.831343 0.901672 0.0
vt 0.648464 0.934539 0.0
vt 0.820574 0.944713 0.0
vt 0.924010 0.967272 0.0
vt 0.820621 0.965201 0.0
vt 0.924010 0.967272 0.0
vt 0.924018 0.997522 0.0
vt 0.820621 0.965201 0.0
vt 0.293013 0.593779 0.0
vt 0.286373 0.750068 0.0
vt 0.198418 0.746828 0.0
vt 0.293013 0.593779 0.0
vt 0.198418 0.746828 0.0
vt 0.100763 0.586697 0.0
vt 0.648996 0.978196 0.0
vt 0.644392 0.732142 0.0
vt 0.811613 0.924611 0.0
vt 0.644392 0.732142 0.0
vt 0.901999 0.726525 0.0
vt 0.811613 0.924611 0.0
vt 0.253938 0.936769 0.0
vt 0.250270 0.740734 0.0
vt 0.644392 0.732142 0.0
vt 0.253938 0.936769 0.0
vt 0.644392 0.732142 0.0
vt 0.648996 0.978196 0.0
vt 0.905882 0.332684 0.0
vt 0.905968 0.227464 0.0
vt 0.977478 0.243313 0.0
vt 0.905882 0.332684 0.0
vt 0.977478 0.243313 0.0
vt 0.977391 0.348533 0.0
vt 0.605686 0.605299 0.0
vt 0.599046 0.761588 0.0
vt 0.293013 0.593779 0.0
vt 0.599046 0.761588 0.0
vt 0.286373 0.750068 0.0
vt 0.293013 0.593779 0.0
vt 0.820410 0.871880 0.0
vt 0.923785 0.894464 0.0
vt 0.820574 0.944713 0.0
vt 0.923785 0.894464 0.0
vt 0.924010 0.967272 0.0
vt 0.820574 0.944713 0.0
vt 0.843532 0.414796 0.0
vt 0.759296 0.351087 0.0
vt 0.759570 0.350729 0.0
vt 0.843532 0.414796 0.0
vt 0.759570 0.350729 0.0
vt 0.843806 0.414437 0.0
vt 0.759352 0.524784 0.0
vt 0.843532 0.414796 0.0
vt 0.821871 0.443097 0.0
vt 0.843532 0.414796 0.0
vt 0.843806 0.414437 0.0
vt 0.821871 0.443097 0.0
vt 0.819983 0.987104 0.0
vt 0.714144 0.986841 0.0
vt 0.714460 0.884394 0.0
vt 0.819983 0.987104 0.0
vt 0.714460 0.884394 0.0
vt 0.820299 0.884656 0.0
vt 0.820409 0.849162 0.0
vt 0.819983 0.987104 0.0
vt 0.820299 0.884656 0.0
vt 0.820409 0.849162 0.0
vt 0.820299 0.884656 0.0
vt 0.820410 0.848712 0.0
vt 0.251067 0.094442 0.0
vt 0.248460 0.939414 0.0
vt 0.077221 0.939690 0.0
vt 0.251067 0.094442 0.0
vt 0.077221 0.939690 0.0
vt 0.079828 0.094718 0.0
vt 0.731622 0.111673 0.0
vt 0.731384 0.006454 0.0
vt 0.759058 0.012498 0.0
vt 0.731622 0.111673 0.0
vt 0.759058 0.012498 0.0
vt 0.759296 0.117718 0.0
vt 0.990332 0.035851 0.0
vt 0.990759 0.174060 0.0
vt 0.962360 0.035936 0.0
vt 0.990759 0.174060 0.0
vt 0.962786 0.174145 0.0
vt 0.962360 0.035936 0.0
vt 0.885363 0.000000 0.0
vt 0.879356 0.105049 0.0
vt 0.857399 0.004537 0.0
vt 0.879356 0.105049 0.0
vt 0.851392 0.109586 0.0
vt 0.857399 0.004537 0.0
vt 0.000000 0.697723 0.0
vt 0.139312 0.639490 0.0
vt 0.139313 0.691508 0.0
vt 0.000000 0.697723 0.0
vt 0.139313 0.691508 0.0
vt 0.000291 0.691084 0.0
vt 0.731622 0.111673 0.0
vt 0.702077 0.105220 0.0
vt 0.731384 0.006454 0.0
vt 0.702077 0.105220 0.0
vt 0.701839 0.000000 0.0
vt 0.731384 0.006454 0.0
vt 0.905882 0.158272 0.0
vt 0.879356 0.105049 0.0
vt 0.899810 0.052989 0.0
vt 0.879356 0.105049 0.0
vt 0.885363 0.000000 0.0
vt 0.899810 0.052989 0.0
vt 0.000321 0.592504 0.0
vt 0.137536 0.534749 0.0
vt 0.139312 0.639490 0.0
vt 0.000321 0.592504 0.0
vt 0.139312 0.639490 0.0
vt 0.000000 0.697723 0.0
vt 0.140579 0.187417 0.0
vt 0.002107 0.006639 0.0
vt 0.141103 0.104313 0.0
vt 0.002107 0.006639 0.0
vt 0.002398 0.000000 0.0
vt 0.141103 0.104313 0.0
vt 0.877681 0.083208 0.0
vt 0.899329 0.808351 0.0
vt 0.173096 0.801416 0.0
vt 0.877681 0.083208 0.0
vt 0.173096 0.801416 0.0
vt 0.133391 0.106765 0.0
vt 0.002107 0.006639 0.0
vt 0.140579 0.187417 0.0
vt 0.000321 0.592504 0.0
vt 0.140579 0.187417 0.0
vt 0.137536 0.534749 0.0
vt 0.000321 0.592504 0.0
vt 0.886058 0.505060 0.0
vt 0.851838 0.586246 0.0
vt 0.879356 0.105049 0.0
vt 0.886058 0.505060 0.0
vt 0.879356 0.105049 0.0
vt 0.905882 0.158272 0.0
vt 0.703405 0.691091 0.0
vt 0.702077 0.105220 0.0
vt 0.731622 0.111673 0.0
vt 0.703405 0.691091 0.0
vt 0.731622 0.111673 0.0
vt 0.732950 0.697545 0.0
vt 0.963664 0.823954 0.0
vt 0.974059 0.586348 0.0
vt 0.999862 0.742949 0.0
vt 0.974059 0.586348 0.0
vt 0.999265 0.586246 0.0
vt 0.999862 0.742949 0.0
vt 0.000223 0.935432 0.0
vt 0.000000 0.697832 0.0
vt 0.030249 0.935340 0.0
vt 0.000000 0.697832 0.0
vt 0.040755 0.697723 0.0
vt 0.030249 0.935340 0.0
vt 0.308962 0.781811 0.0
vt 0.308239 0.547925 0.0
vt 0.637092 0.749080 0.0
vt 0.308239 0.547925 0.0
vt 0.626640 0.546953 0.0
vt 0.637092 0.749080 0.0
vt 1.000000 0.823645 0.0
vt 0.963539 0.823783 0.0
vt 0.963664 0.823954 0.0
vt 1.000000 0.823645 0.0
vt 0.963664 0.823954 0.0
vt 0.999862 0.742949 0.0
vt 0.229746 0.874737 0.0
vt 0.230499 0.637119 0.0
vt 0.270828 0.718168 0.0
vt 0.229746 0.874737 0.0
vt 0.270828 0.718168 0.0
vt 0.269117 0.874857 0.0
vt 0.174193 0.636947 0.0
vt 0.230499 0.637119 0.0
vt 0.229746 0.874737 0.0
vt 0.174193 0.636947 0.0
vt 0.229746 0.874737 0.0
vt 0.173440 0.874566 0.0
vt 0.447815 0.415114 0.0
vt 0.448548 0.652743 0.0
vt 0.412087 0.652855 0.0
vt 0.447815 0.415114 0.0
vt 0.412087 0.652855 0.0
vt 0.411354 0.415225 0.0
vt 0.906078 0.137835 0.0
vt 0.962360 0.138007 0.0
vt 0.905882 0.173974 0.0
vt 0.962360 0.138007 0.0
vt 0.962164 0.174146 0.0
vt 0.905882 0.173974 0.0
vt 0.799296 0.826255 0.0
vt 0.782184 0.599419 0.0
vt 0.926854 0.607007 0.0
vt 0.799296 0.826255 0.0
vt 0.926854 0.607007 0.0
vt 0.915028 0.832325 0.0
vt 0.958164 0.586190 0.0
vt 0.906558 0.586246 0.0
vt 0.905882 0.348619 0.0
vt 0.958164 0.586190 0.0
vt 0.905882 0.348619 0.0
vt 0.963539 0.348533 0.0
vt 0.805287 0.515313 0.0
vt 0.829222 0.771028 0.0
vt 0.278199 0.752081 0.0
vt 0.805287 0.515313 0.0
vt 0.278199 0.752081 0.0
vt 0.181829 0.493876 0.0
vt 0.906825 0.000000 0.0
vt 0.956716 0.026403 0.0
vt 0.906078 0.137835 0.0
vt 0.956716 0.026403 0.0
vt 0.962360 0.138007 0.0
vt 0.906078 0.137835 0.0
vt 0.153388 0.515844 0.0
vt 0.428825 0.501519 0.0
vt 0.147277 0.813547 0.0
vt 0.428825 0.501519 0.0
vt 0.422259 0.826460 0.0
vt 0.147277 0.813547 0.0
vt 0.587613 0.652319 0.0
vt 0.448548 0.652743 0.0
vt 0.586880 0.414690 0.0
vt 0.448548 0.652743 0.0
vt 0.447815 0.415114 0.0
vt 0.586880 0.414690 0.0
vn -0.293553 0.955923 -0.006199
vn -0.214429 0.976442 0.024108
vn 0.000000 0.000000 -1.000000
vn 0.000001 0.000000 -1.000000
vn -1.000000 0.000000 0.000000
vn -0.000001 0.000000 1.000000
vn 0.209503 0.228687 0.950690
vn 1.000000 0.000000 0.000000
vn 0.976598 0.184935 -0.109797
vn 0.776908 -0.629614 0.000000
vn -0.447214 0.894427 0.000000
vn -0.177041 0.721598 0.669293
vn -0.000000 1.000000 0.000000
vn -0.049402 0.998345 -0.029435
vn 0.977393 0.208021 0.037810
vn 0.981593 0.190986 0.000000
vn 0.000000 0.000000 1.000000
vn -0.000014 -1.000000 0.000000
vn 0.129883 0.000000 -0.991529
vn 0.000002 0.115702 -0.993284
vn 0.000018 1.000000 -0.000000
vn 0.000017 1.000000 0.000001
vn 0.939000 0.213518 -0.269610
vn 0.000002 0.000001 -1.000000
vn 0.447214 0.000000 -0.894427
vn -0.000008 -1.000000 0.000000
vn 0.000012 1.000000 0.000000
vn 0.000008 1.000000 -0.000002
vn 0.958063 0.161121 0.236971
vn 1.000000 0.000001 0.000000
vn -1.000000 0.000000 -0.000007
vn 0.707107 0.000000 -0.707107
vn 0.000000 -1.000000 0.000000
vn 0.080594 0.042413 -0.995844
vn -0.384885 0.000000 -0.922964
vn 0.000001 0.065918 -0.997825
vn -0.049375 0.997788 0.044516
vn -0.913699 0.096565 -0.394753
vn 0.094365 0.024170 0.995244
vn -0.055475 0.000000 0.998460
vn -0.055474 0.000000 0.998460
vn 0.998460 0.000000 0.055475
vn -0.998460 -0.000000 -0.055476
vn -0.054190 0.159325 -0.985738
vn 0.054981 0.133100 -0.989576
vn -0.049724 0.423574 -0.904496
vn -0.259706 0.523372 -0.811563
vn -0.346641 0.937800 -0.019260
vn -0.096531 0.948519 -0.301653
vn -0.998460 0.000001 -0.055477
vn -0.998460 0.000001 -0.055476
vn 0.998460 0.000000 0.055477
vn 0.998460 -0.000001 0.055475
vn -0.998460 0.000000 -0.055475
vn -0.998460 0.000001 -0.055475
vn -0.350800 0.930967 0.101188
vn 0.000000 0.000000 0.000000
vn 0.055475 0.000000 -0.998460
vn 0.998460 -0.000000 0.055476
vn -0.821066 0.127490 0.556415
vn -0.998460 0.000000 -0.055474
vn 0.056628 0.997480 0.042748
vn -0.474075 0.042766 0.879445
vn -0.055268 0.086448 0.994722
vn 0.794425 0.253606 0.551882
vn 0.983123 0.174602 0.054622
vn 0.055474 -0.000000 -0.998460
vn -0.028298 0.996641 0.076845
vn 0.139603 0.968627 -0.205602
vn -0.032672 0.998307 0.048122
vn -0.128450 0.000002 -0.991716
vn -0.177871 0.095484 -0.979410
vn -1.000000 -0.000001 -0.000002
vn 1.000000 -0.000000 0.000001
vn 0.852738 0.402896 0.332435
vn -0.000002 -0.000002 1.000000
vn -0.000003 -0.000002 1.000000
vn -0.000001 -0.000001 1.000000
vn -0.000000 -1.000000 -0.000001
vn 1.000000 0.000001 0.000001
vn -1.000000 0.000001 -0.000002
vn -0.000001 0.467678 -0.883899
vn 0.092045 0.382826 -0.919223
vn -1.000000 0.000001 -0.000000
vn 1.000000 -0.000001 -0.000000
vn 0.113121 0.992053 -0.055093
usemtl None_building-base.png
s off
f 85/1/1 88/2/1 87/3/1
f 85/4/2 87/5/2 86/6/2
f 81/7/3 82/8/3 85/9/3
f 82/10/4 88/11/4 85/12/4
f 82/13/5 83/14/5 88/15/5
f 83/16/5 87/17/5 88/18/5
f 83/19/6 84/20/6 87/21/6
f 84/22/7 86/23/7 87/24/7
f 84/25/8 81/26/8 86/27/8
f 81/28/9 85/29/9 86/30/9
f 54/31/10 53/32/10 81/33/10
f 54/34/11 81/35/11 84/36/11
f 55/37/12 54/38/12 83/39/12
f 54/40/13 84/41/13 83/42/13
f 56/43/5 55/44/5 82/45/5
f 55/46/5 83/47/5 82/48/5
f 53/49/14 56/50/14 82/51/14
f 53/52/13 82/53/13 81/54/13
f 77/55/15 80/56/15 78/57/15
f 80/58/16 79/59/16 78/60/16
f 73/61/17 74/62/17 77/63/17
f 74/64/17 80/65/17 77/66/17
f 74/67/18 75/68/18 79/69/18
f 74/70/18 79/71/18 80/72/18
f 75/73/19 76/74/19 78/75/19
f 75/76/20 78/77/20 79/78/20
f 76/79/21 73/80/21 77/81/21
f 76/82/22 77/83/22 78/84/22
f 69/85/23 70/86/23 76/87/23
f 70/88/8 73/89/8 76/90/8
f 71/91/24 69/92/24 76/93/24
f 71/94/25 76/95/25 75/96/25
f 72/97/5 71/98/5 75/99/5
f 72/100/5 75/101/5 74/102/5
f 70/103/17 72/104/17 73/105/17
f 72/106/17 74/107/17 73/108/17
f 66/109/17 65/110/17 72/111/17
f 66/112/17 72/113/17 70/114/17
f 65/115/26 67/116/26 71/117/26
f 65/118/26 71/119/26 72/120/26
f 67/121/3 68/122/3 69/123/3
f 67/124/3 69/125/3 71/126/3
f 68/127/27 66/128/27 69/129/27
f 66/130/28 70/131/28 69/132/28
f 61/133/29 62/134/29 66/135/29
f 61/136/30 66/137/30 68/138/30
f 63/139/31 61/140/31 68/141/31
f 63/142/32 68/143/32 67/144/32
f 64/145/5 63/146/5 67/147/5
f 64/148/5 67/149/5 65/150/5
f 62/151/17 64/152/17 66/153/17
f 64/154/17 65/155/17 66/156/17
f 53/157/17 49/158/17 62/159/17
f 49/160/17 64/161/17 62/162/17
f 49/163/33 59/164/33 63/165/33
f 49/166/33 63/167/33 64/168/33
f 59/169/3 60/170/3 63/171/3
f 60/172/34 61/173/34 63/174/34
f 60/175/13 53/176/13 62/177/13
f 60/178/13 62/179/13 61/180/13
f 60/181/35 59/182/35 58/183/35
f 59/184/36 57/185/36 58/186/36
f 49/187/33 52/188/33 59/189/33
f 52/190/33 57/191/33 59/192/33
f 56/193/37 53/194/37 58/195/37
f 53/196/13 60/197/13 58/198/13
f 52/199/5 56/200/5 57/201/5
f 56/202/38 58/203/38 57/204/38
f 51/205/5 55/206/5 52/207/5
f 55/208/5 56/209/5 52/210/5
f 50/211/39 54/212/39 55/213/39
f 50/214/17 55/215/17 51/216/17
f 49/217/8 53/218/8 54/219/8
f 49/220/8 54/221/8 50/222/8
f 49/223/33 50/224/33 51/225/33
f 49/226/33 51/227/33 52/228/33
f 48/229/33 47/230/33 46/231/33
f 48/232/33 46/233/33 45/234/33
f 40/235/40 39/236/40 47/237/40
f 40/238/41 47/239/41 48/240/41
f 41/241/42 40/242/42 48/243/42
f 41/244/42 48/245/42 45/246/42
f 39/247/43 43/248/43 47/249/43
f 43/250/43 46/251/43 47/252/43
f 43/253/44 41/254/44 46/255/44
f 41/256/45 45/257/45 46/258/45
f 42/259/46 41/260/46 43/261/46
f 42/262/47 43/263/47 44/264/47
f 38/265/48 37/266/48 44/267/48
f 37/268/49 42/269/49 44/270/49
f 39/271/50 38/272/50 44/273/50
f 39/274/51 44/275/51 43/276/51
f 37/277/52 40/278/52 42/279/52
f 40/280/53 41/281/53 42/282/53
f 34/283/42 33/284/42 40/285/42
f 34/286/42 40/287/42 37/288/42
f 33/289/33 35/290/33 39/291/33
f 33/292/33 39/293/33 40/294/33
f 35/295/54 36/296/54 39/297/54
f 36/298/55 38/299/55 39/300/55
f 36/301/13 34/302/13 38/303/13
f 34/304/56 37/305/56 38/306/56
f 30/307/40 29/308/40 34/309/40
f 30/310/40 34/311/40 36/312/40
f 31/313/57 30/314/57 35/315/57
f 30/316/57 36/317/57 35/318/57
f 32/319/58 31/320/58 35/321/58
f 32/322/58 35/323/58 33/324/58
f 29/325/57 32/326/57 33/327/57
f 29/328/57 33/329/57 34/330/57
f 23/331/59 19/332/59 32/333/59
f 23/334/42 32/335/42 29/336/42
f 19/337/33 26/338/33 31/339/33
f 19/340/33 31/341/33 32/342/33
f 26/343/43 25/344/43 31/345/43
f 25/346/54 30/347/54 31/348/54
f 25/349/13 23/350/13 30/351/13
f 23/352/13 29/353/13 30/354/13
f 28/355/60 27/356/60 25/357/60
f 28/358/61 25/359/61 26/360/61
f 19/361/33 18/362/33 26/363/33
f 18/364/33 28/365/33 26/366/33
f 22/367/62 23/368/62 27/369/62
f 23/370/13 25/371/13 27/372/13
f 18/373/63 22/374/63 27/375/63
f 18/376/64 27/377/64 28/378/64
f 21/379/65 17/380/65 24/381/65
f 17/382/66 20/383/66 24/384/66
f 19/385/67 23/386/67 24/387/67
f 19/388/67 24/389/67 20/390/67
f 17/391/41 21/392/41 18/393/41
f 21/394/41 22/395/41 18/396/41
f 21/397/13 24/398/13 23/399/13
f 21/400/68 23/401/68 22/402/68
f 17/403/33 18/404/33 19/405/33
f 17/406/33 19/407/33 20/408/33
f 15/409/69 16/410/69 13/411/69
f 16/412/70 14/413/70 13/414/70
f 6/415/71 7/416/71 15/417/71
f 7/418/72 16/419/72 15/420/72
f 7/421/73 9/422/73 16/423/73
f 9/424/5 14/425/5 16/426/5
f 11/427/74 6/428/74 15/429/74
f 11/430/75 15/431/75 13/432/75
f 9/433/76 11/434/76 13/435/76
f 9/436/77 13/437/77 14/438/77
f 12/439/76 11/440/76 9/441/76
f 12/442/78 9/443/78 10/444/78
f 3/445/79 2/446/79 12/447/79
f 3/448/79 12/449/79 10/450/79
f 2/451/80 6/452/80 12/453/80
f 6/454/80 11/455/80 12/456/80
f 7/457/81 3/458/81 10/459/81
f 7/460/81 10/461/81 9/462/81
f 5/463/82 1/464/82 4/465/82
f 5/466/83 4/467/83 8/468/83
f 3/469/84 7/470/84 8/471/84
f 3/472/5 8/473/5 4/474/5
f 1/475/85 5/476/85 2/477/85
f 5/478/80 6/479/80 2/480/80
f 5/481/86 8/482/86 6/483/86
f 8/484/13 7/485/13 6/486/13
f 1/487/33 2/488/33 4/489/33
f 2/490/33 3/491/33 4/492/33

2337
hayfever/meshes/car.obj Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
# Blender3D MTL File: <memory>
# Material Count: 1
newmtl None_ground-base.png
Ns 0
Ka 0.000000 0.000000 0.000000
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2
map_Kd ground-base.png

2986
hayfever/meshes/ground.obj Normal file

File diff suppressed because it is too large Load diff

1044
hayfever/meshes/set.obj Normal file

File diff suppressed because it is too large Load diff

99
hayfever/set-test.scm Normal file
View file

@ -0,0 +1,99 @@
(define (build-shells obj count dist col)
(when (not (zero? count))
(with-state
(parent obj)
(colour col)
(let ((shell (build-copy obj)))
(with-primitive shell
(pdata-map!
(lambda (p n)
(vadd p (vmul (vector 0 1 0) dist)))
"p" "n"))
(build-shells shell (- count 1) dist (vmul col 1))))))
(define (build-shrub p n)
(with-state
(translate p)
(colour (vector 0.5 0.7 0.4))
(let ((shrub (build-ribbon (+ (random 10) 2))))
(with-primitive shrub
(pdata-index-map!
(lambda (i p)
(let ((j (* 0.2 (* i 0.2))))
(vector (* (crndf) j) (* i 0.2) (* (crndf) j))))
"p")
(pdata-index-map!
(lambda (i w)
(* (/ 1 (+ i 1)) 0.2))
"w")))))
(clear)
;----------------------------------------------
; build the set
(clear-colour (vector 0.5 0.8 1))
(define l (make-light 'spot 'free))
(light-diffuse 0 (vector 0 0 0))
(light-diffuse l (vector 1 1 1))
(light-position l (vector 0 9 -10))
(define l2 (make-light 'spot 'free))
(light-diffuse l2 (vector 0.5 0.5 0.5))
(light-position l2 (vector 0 9 10))
(clear-texture-cache)
(clear-geometry-cache)
(with-state
(backfacecull 0)
(texture (load-texture "textures/car-base.png"))
(load-primitive "meshes/car.obj"))
(define terrain (with-state
(texture (load-texture "textures/ground-base.png"))
(load-primitive "meshes/ground.obj")))
;(define grassmap (load-primitive "textures/set-grass.png"))
(define (tx->pi tx)
(+ (vy tx) (* (vx tx) (pixels-width))))
(with-primitive terrain
(poly-for-each-tri-sample
(lambda (indices bary)
(let ((tc (vadd
(vmul (pdata-ref "t" (list-ref indices 0)) (vx bary))
(vmul (pdata-ref "t" (list-ref indices 1)) (vy bary))
(vmul (pdata-ref "t" (list-ref indices 2)) (vz bary)))))
(when #t #;(> (va (with-primitive grassmap (pdata-ref "c" (tx->pi tc)))) 0.5)
(build-shrub (vadd
(vmul (pdata-ref "p" (list-ref indices 0)) (vx bary))
(vmul (pdata-ref "p" (list-ref indices 1)) (vy bary))
(vmul (pdata-ref "p" (list-ref indices 2)) (vz bary))) (vector 0 1 0)))))
1))
(define shell0 (build-copy terrain))
(with-primitive shell0
(pdata-copy "t" "t1")
(pdata-map!
(lambda (t)
(vmul t 4))
"t"))
(with-state
(multitexture 0 (load-texture "textures/shell.png"))
(multitexture 1 (load-texture "textures/ground-grassmap.png"))
(build-shells shell0 4 0.1 (vector 1 1 1)))
(define buildings (with-state
(backfacecull 0)
(texture (load-texture "textures/building-base.png"))
(load-primitive "meshes/buildings.obj")))
(with-state
(multitexture 0 (load-texture "textures/shell.png"))
(multitexture 1 (load-texture "textures/building-grassmap.png"))
(build-shells buildings 4 0.04 (vector 1 1 1)))

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
hayfever/textures/shell.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

View file

@ -54,7 +54,7 @@
(map (map
(lambda (cp) (lambda (cp)
(vector (- (- (/ (vx cp) (pixels-width)) 0.5)) (vector (- (- (/ (vx cp) (pixels-width)) 0.5))
(- 1 (/ (vy cp) (pixels-height))) 0)) (/ (vy cp) (pixels-height)) 0))
l)) l))
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~