diff --git a/BloubWorld/bloubspace.f90 b/BloubWorld/bloubspace.f90 index 4738154..68a6118 100644 --- a/BloubWorld/bloubspace.f90 +++ b/BloubWorld/bloubspace.f90 @@ -88,10 +88,10 @@ module bloubspace blb%py = 0.0 blb%age = blb%age + 1 endif - if (5.0 .lt. blb%py) then + if (4.99 .lt. blb%py) then !! blb%vy = -1.0 * blb%vy blb%age = blb%age + 1 - blb%py = 5.0 + blb%py = 4.99 !! endif if (5.0 .lt. blb%pz) then diff --git a/BloubWorld/essai.f90 b/BloubWorld/essai.f90 index 78ee35a..81cadce 100644 --- a/BloubWorld/essai.f90 +++ b/BloubWorld/essai.f90 @@ -5,12 +5,15 @@ program essai integer :: foo real :: quux + double precision :: somme call init_random_seed() + somme = 0.0 do foo=1, 200000 quux = rand() - print *, foo, quux + somme = somme + quux + print *, foo, quux, somme/foo enddo end program \ No newline at end of file diff --git a/BloubWorld/exportbloubs.f90 b/BloubWorld/exportbloubs.f90 index ea22cfa..ecad94a 100644 --- a/BloubWorld/exportbloubs.f90 +++ b/BloubWorld/exportbloubs.f90 @@ -32,7 +32,7 @@ program genbloubs if (0 .ne. errcode) then exit endif - print *, bloub%px, bloub%py, bloub%pz, bloub%radius + print *, bloub%px, bloub%py, bloub%pz, bloub%radius, bloub%age compte = compte + 1 enddo diff --git a/BloubWorld/mergebloubs.f90 b/BloubWorld/mergebloubs.f90 index 3ec40db..8112c35 100644 --- a/BloubWorld/mergebloubs.f90 +++ b/BloubWorld/mergebloubs.f90 @@ -70,6 +70,11 @@ program mergebloubs do ! infinite loop print *, "============ PASS ", idx + if (idx .EQ. NB_MAX_BLOUBS) then + write(0, '(I8, A)') idx, " max number of bloubs reached" + exit + endif + ! read the next bloub from input file read (unit=inu, iostat=errcode) bloub if (0 .ne. errcode) then @@ -89,9 +94,7 @@ program mergebloubs ! call display_bloub(les_bloubs(i), "DEAD ? WTF ?") cycle endif - rval = distance_of_bloubs(les_bloubs(i), bloub) - if (rval .LT. (les_bloubs(i)%radius + bloub%radius)) then print *, "contact : ", i, idx, rval call merge_two_bloubs(les_bloubs(i), bloub, newbloub) @@ -99,16 +102,21 @@ program mergebloubs nbr_merge = nbr_merge + 1 merged = .TRUE. endif - enddo + if (merged) then - ! put new bloub in the list les_bloubs(idx) = newbloub + bloub = newbloub else ! put old bloub in the list les_bloubs(idx) = bloub endif + write(outu, iostat=errcode) bloub ! no error control ? + if (0 .ne. errcode) then + STOP " : WRITE ERROR TO " // trim(outfile) + endif + idx = idx + 1 ! print *, "idx = ", idx diff --git a/BloubWorld/movebloubs.f90 b/BloubWorld/movebloubs.f90 index be66b9e..d65098b 100644 --- a/BloubWorld/movebloubs.f90 +++ b/BloubWorld/movebloubs.f90 @@ -54,7 +54,7 @@ program movebloubs endif ! moving and boundingboxing - call move_bloub (bloub, 0.15) + call move_bloub (bloub, 0.14) call bound_a_blob (bloub) call green_soylent (bloub) if (.NOT. bloub%alive) then @@ -78,10 +78,10 @@ program movebloubs ! ok, we have read all the bloubs in the input file ! insert some fancy conditional here - if (compteur .LT. 1500) then - - call add_more_bloubs(outu, 8, 0.075) - + if (compteur .LT. 1600) then + if (rand() .LT. 0.05) then + call add_more_bloubs(outu, 8, 0.052) + endif endif close(inu) ; close(outu) @@ -104,13 +104,15 @@ contains type(t_bloubs) :: bloub integer :: foo + write(0, '(A,I4,1X,A)') "adding", nbre, "bloubs" + do foo=1, nbre bloub%nick = 'newbie ' - bloub%alive = .TRUE. call random_pv(bloub) bloub%radius = wtf - bloub%age = foo + bloub%age = 1 + bloub%alive = .TRUE. ! call display_bloub (bloub, "new bloub") write(un) bloub ! no error control ? diff --git a/BloubWorld/runme.sh b/BloubWorld/runme.sh index f3753fe..fbdb0cd 100755 --- a/BloubWorld/runme.sh +++ b/BloubWorld/runme.sh @@ -7,7 +7,7 @@ INCFILE="bloubs.inc" TMPPNG="/dev/shm/bloubs7.png" -POVOPT="+Q5 -a -v -d -W920 -H600 -WT2" +POVOPT="+Q9 +a -v -d -W960 -H640 -WT2" DDIR="frames" LOGERR="log.error" @@ -15,7 +15,7 @@ LOGERR="log.error" BLBS_IN="/dev/shm/in.blbs" BLBS_OUT="/dev/shm/out.blbs" -NBIMG=600 +NBIMG=1200 make all err=$? @@ -67,7 +67,7 @@ do mv ${BLBS_OUT} ${BLBS_IN} echo - sleep 33 + sleep 9 done diff --git a/BloubWorld/toinc.awk b/BloubWorld/toinc.awk index d6d0b18..5afd78a 100644 --- a/BloubWorld/toinc.awk +++ b/BloubWorld/toinc.awk @@ -11,8 +11,12 @@ BEGIN { } { - printf "\t\tsphere { <%f, %f, %f>, %f }\n", \ - $1, $2, $3, $4 + if ($5 > 4) color = "Magenta" + else color = "Cyan" + + pigment = "pigment { color " color " }" + printf "\t\tsphere { <%f, %f, %f>, %f %s }\n", \ + $1, $2, $3, $4, pigment count++ }