pimping the bloubworld
This commit is contained in:
parent
bf487c389c
commit
60dac4d948
@ -12,7 +12,6 @@ Tout est expliqué dans ce [document](doc/what-is-a-bloub.md).
|
|||||||
la structure d'un bloub est (presque) simple, en fait.
|
la structure d'un bloub est (presque) simple, en fait.
|
||||||
Le plus compliqué, c'est de savoir quoi faire de ce fatras
|
Le plus compliqué, c'est de savoir quoi faire de ce fatras
|
||||||
de *bigdata*.
|
de *bigdata*.
|
||||||
|
|
||||||
On peut fabriquer des gazillions de bloubs, et ensuite
|
On peut fabriquer des gazillions de bloubs, et ensuite
|
||||||
les lacher dans un espace clôt, avec des parois
|
les lacher dans un espace clôt, avec des parois
|
||||||
rebondissantes.
|
rebondissantes.
|
||||||
@ -39,7 +38,8 @@ de fichier qui va être modifié assez souvent, ne gardez pas d'archives.
|
|||||||
### genbloubs
|
### genbloubs
|
||||||
|
|
||||||
Fabrication d'une population de bloubs plus ou moins aléatoires.
|
Fabrication d'une population de bloubs plus ou moins aléatoires.
|
||||||
Deux paramètres : le nom du fichier et le nombre de bloubs.
|
Deux paramètres : le nom du fichier (extention `.blbs`)
|
||||||
|
et le nombre de bloubs désirés.
|
||||||
Les règles de génération *devraient* être paramétrables.
|
Les règles de génération *devraient* être paramétrables.
|
||||||
[source](genbloubs.f90)
|
[source](genbloubs.f90)
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ program exportbloubs
|
|||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
write(0, '(1X, I8, A)') compte, " bloubs exported"
|
write(0, '(1X, I0, A)') compte, " bloubs exported"
|
||||||
|
|
||||||
close(idu)
|
close(idu)
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ program mergebloubs
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
call spit_bloubs_to_file (outfile, bloubs, nbgot)
|
call spit_bloubs_to_file (outfile, bloubs, nbgot)
|
||||||
print *, contacts, "contacts pour ", nbgot, "bloubs"
|
! print *, contacts, "contacts pour ", nbgot, "bloubs"
|
||||||
|
|
||||||
! STOP 'mergebloubs [done]'
|
! STOP 'mergebloubs [done]'
|
||||||
|
|
||||||
|
@ -83,28 +83,28 @@ program movebloubs
|
|||||||
|
|
||||||
enddo ! end of main loop
|
enddo ! end of main loop
|
||||||
|
|
||||||
write(0, '(I5,1X,A)') compteur, "bloubs processed"
|
write(0, '(1X,I0,1X,A)') compteur, "bloubs processed"
|
||||||
|
|
||||||
! ok, we have read all the bloubs in the input file
|
! ok, we have read all the bloubs in the input file
|
||||||
|
|
||||||
! insert some fancy conditional here
|
! insert some fancy conditional here
|
||||||
if (compteur .LT. 200) then
|
if (compteur .LT. 200) then
|
||||||
call add_more_bloubs(outu, 4, 0.1056)
|
call add_more_bloubs(outu, 4, 0.026)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
! insert some very fancy conditional here
|
! insert some very fancy conditional here
|
||||||
if (compteur .LT. 800) then
|
if (compteur .LT. 800) then
|
||||||
rnd = rand()
|
rnd = rand()
|
||||||
write (0, '(A,1X,F9.6)') "try to add bloubs, rnd is", rnd
|
! write (0, '(A,1X,F9.6)') "try to add bloubs, rnd is", rnd
|
||||||
if (rnd .LT. 0.0604) then
|
if (rnd .LT. 0.0604) then
|
||||||
call add_more_bloubs(outu, 11, 0.099)
|
call add_more_bloubs(outu, 11, 0.019)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
close(inu) ; close(outu)
|
close(inu) ; close(outu)
|
||||||
|
|
||||||
if (killed .GT. 0) then
|
if (killed .GT. 0) then
|
||||||
write (0, '(I5,A)') killed, " bloubs killed"
|
write (0, '(1X,I0,A)') killed, " bloubs killed"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
bx = bx / dble(compteur)
|
bx = bx / dble(compteur)
|
||||||
@ -128,7 +128,7 @@ contains
|
|||||||
|
|
||||||
bloub%nick = 'newbie '
|
bloub%nick = 'newbie '
|
||||||
call make_a_random_bloub(bloub)
|
call make_a_random_bloub(bloub)
|
||||||
bloub%radius = rayon + (0.15*rand())
|
bloub%radius = rayon + (0.05*rand())
|
||||||
bloub%age = 1
|
bloub%age = 1
|
||||||
bloub%alive = .TRUE.
|
bloub%alive = .TRUE.
|
||||||
bloub%num = mod(irand(), 42)
|
bloub%num = mod(irand(), 42)
|
||||||
|
@ -7,16 +7,16 @@
|
|||||||
|
|
||||||
INCFILE="WS/bloubs.inc"
|
INCFILE="WS/bloubs.inc"
|
||||||
TMPPNG="/dev/shm/bloubs7.png"
|
TMPPNG="/dev/shm/bloubs7.png"
|
||||||
POVOPT="+Q9 +a -v -d -W1600 -H1200 -WT2"
|
POVOPT="+Q9 -a -v -d -W1600 -H1200 -WT2"
|
||||||
DDIR="frames/a"
|
DDIR="frames/a"
|
||||||
LOGERR="log.error"
|
LOGERR="log.error"
|
||||||
TXTCOLOR="GreenYellow"
|
TXTCOLOR="#db7000"
|
||||||
|
|
||||||
# --- put the work file in ramdisk
|
# --- put the work file in ramdisk
|
||||||
BLBS_IN="/dev/shm/in.blbs"
|
BLBS_IN="/dev/shm/in.blbs"
|
||||||
BLBS_OUT="/dev/shm/out.blbs"
|
BLBS_OUT="/dev/shm/out.blbs"
|
||||||
|
|
||||||
NBIMG=3000
|
NBIMG=120
|
||||||
|
|
||||||
make all
|
make all
|
||||||
err=$?
|
err=$?
|
||||||
@ -31,7 +31,7 @@ printf "\n#declare NbImg = %d;\n" $NBIMG > WS/nbimg.inc
|
|||||||
# first, we have to make a seminal buch of bloubs
|
# first, we have to make a seminal buch of bloubs
|
||||||
# --> this function need to be parametrizable
|
# --> this function need to be parametrizable
|
||||||
#
|
#
|
||||||
./genbloubs ${BLBS_IN} 3
|
./genbloubs ${BLBS_IN} 50
|
||||||
|
|
||||||
for idx in $(seq 0 $((NBIMG-1)) )
|
for idx in $(seq 0 $((NBIMG-1)) )
|
||||||
do
|
do
|
||||||
@ -43,11 +43,11 @@ do
|
|||||||
povray -Iscene.pov -K${idx} -O${TMPPNG} ${POVOPT} 2> $LOGERR
|
povray -Iscene.pov -K${idx} -O${TMPPNG} ${POVOPT} 2> $LOGERR
|
||||||
if [ 0 -ne $? ] ; then
|
if [ 0 -ne $? ] ; then
|
||||||
tail -15 $LOGERR
|
tail -15 $LOGERR
|
||||||
sleep 30
|
sleep 90
|
||||||
fi
|
fi
|
||||||
|
|
||||||
td=$(date +'%F %R:%S')
|
td=$(date -u +'%F %R:%S' | tr '01' 'ol')
|
||||||
hi=$(printf "#%05d" $idx)
|
hi=$(printf "#%05d" $idx | tr '01' 'ol')
|
||||||
count=$(tail -1 "WS/log.nb_bloubs")
|
count=$(tail -1 "WS/log.nb_bloubs")
|
||||||
|
|
||||||
PNG=$(printf "%s/%05d.png" ${DDIR} $idx)
|
PNG=$(printf "%s/%05d.png" ${DDIR} $idx)
|
||||||
|
@ -29,20 +29,23 @@ object {
|
|||||||
finish { phong 0.57 specular 0.57 }
|
finish { phong 0.57 specular 0.57 }
|
||||||
}
|
}
|
||||||
|
|
||||||
object {
|
#declare La_Boite = object
|
||||||
union {
|
{
|
||||||
|
union {
|
||||||
plane { <1, 0, 0>, -37 }
|
plane { <1, 0, 0>, -37 }
|
||||||
plane { <1, 0, 0>, 37 }
|
plane { <1, 0, 0>, 37 }
|
||||||
plane { <0, 1, 0>, -27 }
|
plane { <0, 1, 0>, -27 }
|
||||||
plane { <0, 1, 0>, 27 }
|
plane { <0, 1, 0>, 27 }
|
||||||
plane { <0, 0, 1>, 69 }
|
plane { <0, 0, 1>, 69 }
|
||||||
|
|
||||||
texture {
|
texture {
|
||||||
pigment { color srgb <0.125, 0.144, 0.111> }
|
pigment { color srgb <0.225, 0.244, 0.211> }
|
||||||
finish { phong 0.18 metallic 0.25 reflection 0.35 }
|
finish { phong 0.18 metallic 0.25 reflection 0.35 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plane { y, 0 pigment { color White } translate -4.20*y}
|
||||||
|
|
||||||
|
|
||||||
// object { cylinder { <0, 0, 0>, <10, 0, 0>, 0.05 pigment { color Cyan } } }
|
// object { cylinder { <0, 0, 0>, <10, 0, 0>, 0.05 pigment { color Cyan } } }
|
||||||
|
|
||||||
@ -56,7 +59,7 @@ object {
|
|||||||
{
|
{
|
||||||
merge {
|
merge {
|
||||||
cylinder { <0, BV, 0>, <0, -BV, 0>, BR }
|
cylinder { <0, BV, 0>, <0, -BV, 0>, BR }
|
||||||
cylinder { <0, 0.014, 0>, <0, -0.014, 0>, BR*4 }
|
cylinder { <0, 0.018, 0>, <0, -0.018, 0>, BR*3 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,8 +112,8 @@ union {
|
|||||||
}
|
}
|
||||||
// ----------------------------------------------------------
|
// ----------------------------------------------------------
|
||||||
|
|
||||||
light_source { <19, -12+NormClock, -17> color Gray80 }
|
light_source { <19, 12+NormClock, -17> color Gray80 }
|
||||||
light_source { <11, 14-NormClock, 9> color Gray60 }
|
light_source { <11, 10-NormClock, -29> color Gray60 }
|
||||||
|
|
||||||
#declare XCAM = 8 - ( 15 * NormClock);
|
#declare XCAM = 8 - ( 15 * NormClock);
|
||||||
#declare YCAM = -1.1 + (0.95 * NormClock);
|
#declare YCAM = -1.1 + (0.95 * NormClock);
|
||||||
|
Loading…
Reference in New Issue
Block a user