Compare commits
No commits in common. "123c87b126cd6b3f79c9226c92f33d762059b02b" and "0934b49bc6201f170e800ffacc289aa113ab0b92" have entirely different histories.
123c87b126
...
0934b49bc6
@ -24,12 +24,12 @@ module bloubspace
|
||||
type(t_bloubs), intent (inout) :: blb
|
||||
|
||||
blb%px = 1.3 * (rand() - 0.50)
|
||||
blb%py = 0.50 + rand() * 0.50
|
||||
blb%py = rand() * 0.50
|
||||
blb%pz = 2.0 * (rand() - 0.50)
|
||||
|
||||
blb%vx = (rand() - 0.5) / 2.500
|
||||
blb%vy = (rand() - 0.5) / 4.000
|
||||
blb%vz = (rand() - 0.5) / 2.500
|
||||
blb%vx = (rand() - 0.5) / 3.000
|
||||
blb%vy = (rand() - 0.5) / 3.000
|
||||
blb%vz = (rand() - 0.5) / 3.000
|
||||
|
||||
blb%alive = .TRUE.
|
||||
|
||||
@ -87,10 +87,10 @@ module bloubspace
|
||||
blb%py = 0.0
|
||||
blb%seq = blb%seq + 1
|
||||
endif
|
||||
if (5.0 .lt. blb%py) then
|
||||
if (3.0 .lt. blb%py) then
|
||||
blb%vy = -1.0 * blb%vy
|
||||
blb%seq = blb%seq + 1
|
||||
blb%py = 5.0
|
||||
blb%py = 3.0
|
||||
endif
|
||||
|
||||
if (5.0 .lt. blb%pz) then
|
||||
@ -109,7 +109,7 @@ module bloubspace
|
||||
! ----------------------------------------------------------------
|
||||
subroutine green_soylent (blb)
|
||||
type(t_bloubs), intent (inout) :: blb
|
||||
if (blb%seq .gt. 6) then
|
||||
if (blb%seq .gt. 4) then
|
||||
blb%alive = .FALSE.
|
||||
endif
|
||||
end subroutine
|
||||
|
@ -75,13 +75,16 @@ program movebloubs
|
||||
|
||||
enddo
|
||||
|
||||
! ok, we have read all the bloubs in the input file
|
||||
|
||||
! insert some fancy conditional here
|
||||
if (add_new_bloub) then
|
||||
! and now, we inject a new bloub in the universe
|
||||
bloub%nick = 'newbie '
|
||||
bloub%alive = .TRUE.
|
||||
call random_pv(bloub)
|
||||
bloub%radius = 0.045
|
||||
bloub%seq = 0
|
||||
|
||||
call add_more_bloubs(outu, 8, 0.095)
|
||||
|
||||
call display_bloub (bloub, "new bloub")
|
||||
write(outu) bloub ! no error control ?
|
||||
endif
|
||||
|
||||
close(inu) ; close(outu)
|
||||
@ -95,29 +98,5 @@ program movebloubs
|
||||
bz = bz / dble(compteur)
|
||||
write (0, '(A,3(F12.6,3X))') "barycentre : ", bx, by, bz
|
||||
|
||||
! --------------------------------------------------------------
|
||||
contains
|
||||
|
||||
subroutine add_more_bloubs(un, nbre, wtf)
|
||||
integer, intent(in) :: un, nbre
|
||||
real, intent(in) :: wtf
|
||||
type(t_bloubs) :: bloub
|
||||
integer :: foo
|
||||
|
||||
do foo=1, nbre
|
||||
|
||||
bloub%nick = 'newbie '
|
||||
bloub%alive = .TRUE.
|
||||
call random_pv(bloub)
|
||||
bloub%radius = wtf
|
||||
bloub%seq = foo
|
||||
call display_bloub (bloub, "new bloub")
|
||||
write(un) bloub ! no error control ?
|
||||
|
||||
enddo
|
||||
|
||||
end subroutine
|
||||
|
||||
! --------------------------------------------------------------
|
||||
|
||||
end program movebloubs
|
||||
end program
|
@ -7,19 +7,16 @@
|
||||
|
||||
INCFILE="bloubs.inc"
|
||||
TMPPNG="/dev/shm/bloubs7.png"
|
||||
POVOPT="+Q9 +a -v -d -W920 -H600 -WT2"
|
||||
POVOPT="+Q9 +a -v -d -W920 -H600"
|
||||
DDIR="frames"
|
||||
LOGERR="log.error"
|
||||
|
||||
BLBS_IN="/dev/shm/in.blbs"
|
||||
BLBS_OUT="/dev/shm/out.blbs"
|
||||
|
||||
NBIMG=4000
|
||||
|
||||
make all
|
||||
err=$?
|
||||
if [ $err -ne 0 ] ; then
|
||||
echo 'make error code is = ' $err
|
||||
echo 'make error = ' $err
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -29,14 +26,14 @@ printf "\n#declare NbImg = %d;\n" $NBIMG > nbimg.inc
|
||||
# first, we have to make a seminal buch of bloubs
|
||||
# --> this function need to be paraletrizable
|
||||
#
|
||||
./genbloubs ${BLBS_IN} 5000
|
||||
./genbloubs in.blbs 9000
|
||||
|
||||
for idx in $(seq 0 $NBIMG)
|
||||
do
|
||||
|
||||
echo "======== run passe $idx ========="
|
||||
|
||||
./exportbloubs ${BLBS_IN} | awk -f toinc.awk > $INCFILE
|
||||
./exportbloubs in.blbs | awk -f toinc.awk > $INCFILE
|
||||
|
||||
povray -Iscene.pov -K${idx} -O${TMPPNG} ${POVOPT} 2> $LOGERR
|
||||
if [ 0 -ne $? ] ; then
|
||||
@ -47,23 +44,22 @@ do
|
||||
fi
|
||||
|
||||
td=$(date +'%F %R:%S')
|
||||
hi=$(printf "#%05d" $idx)
|
||||
txt=$(printf "%5d %s" $idx "${td}")
|
||||
PNG=$(printf "%s/%05d.png" ${DDIR} $idx)
|
||||
echo "$txt" | tee -a log.txt
|
||||
|
||||
convert ${TMPPNG} \
|
||||
-font Courier-Bold \
|
||||
-pointsize 22 \
|
||||
-fill CadetBlue \
|
||||
-font fixed \
|
||||
-pointsize 20 \
|
||||
-fill Orange \
|
||||
-gravity south-east \
|
||||
-annotate +15+10 "$td" \
|
||||
-gravity south-west \
|
||||
-annotate +15+10 "$hi" \
|
||||
-annotate +15+10 "$txt" \
|
||||
$PNG
|
||||
|
||||
echo $PNG '[done]'
|
||||
|
||||
./movebloubs ${BLBS_IN} ${BLBS_OUT}
|
||||
mv ${BLBS_OUT} ${BLBS_IN}
|
||||
./movebloubs in.blbs out.blbs
|
||||
mv out.blbs in.blbs
|
||||
echo
|
||||
|
||||
done
|
||||
|
@ -30,7 +30,7 @@ object {
|
||||
plane {
|
||||
<0, 1, 0>, 0
|
||||
texture {
|
||||
pigment { color Gray05 }
|
||||
pigment { color Black }
|
||||
finish { phong 0.18 metallic 0.45 }
|
||||
}
|
||||
}
|
||||
@ -38,14 +38,14 @@ plane {
|
||||
// ----------------------------------------------------------
|
||||
|
||||
#declare BH = 5;
|
||||
#declare BV = 5;
|
||||
#declare BV = 3;
|
||||
#declare BR = 0.025;
|
||||
|
||||
#declare Une_Borne = object
|
||||
{
|
||||
union {
|
||||
cylinder { <0, 0, 0>, <0, BV, 0>, BR }
|
||||
cylinder { <0, 0, 0>, <0, 0.02, 0>, BR*6 }
|
||||
cylinder { <0, 0, 0>, <0, 0.02, 0>, BR*7 }
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,18 +63,14 @@ object { Les_Bornes }
|
||||
|
||||
// ----------------------------------------------------------
|
||||
|
||||
light_source { <9, 22, -17> color Gray80 }
|
||||
light_source { <11, 19, 9> color Gray60 }
|
||||
light_source { <4, 12, -11> color Gray80 }
|
||||
light_source { <7, 19, 9> color Gray60 }
|
||||
|
||||
#declare HCAM = 5 + (11 * NormClock);
|
||||
|
||||
#fopen LC "log.camera" append
|
||||
#write (LC, clock, " ", NormClock, " ", HCAM, "\n")
|
||||
#fclose LC
|
||||
#declare HCAM = 5 + (7 * NormClock);
|
||||
|
||||
camera {
|
||||
location <7, HCAM, -16>
|
||||
look_at <0, 1, 0>
|
||||
location <6, HCAM, -16>
|
||||
look_at <0, 0, 0>
|
||||
right x*image_width/image_height
|
||||
angle 50
|
||||
angle 48
|
||||
}
|
||||
|
5
Fraktalism/.gitignore
vendored
5
Fraktalism/.gitignore
vendored
@ -1,5 +0,0 @@
|
||||
|
||||
julia
|
||||
|
||||
*.pgm
|
||||
*.gif
|
@ -1,19 +0,0 @@
|
||||
|
||||
GFOPT = -Wall -Wextra -time -g
|
||||
|
||||
# ---------------------------------------------
|
||||
|
||||
spitpgm.o: spitpgm.f90 Makefile
|
||||
gfortran $(GFOPT) -c $<
|
||||
|
||||
fraktals.o: fraktals.f90 Makefile
|
||||
gfortran $(GFOPT) -c $<
|
||||
|
||||
OBJS = spitpgm.o fraktals.o
|
||||
|
||||
# ---------------------------------------------
|
||||
|
||||
julia: julia.f90 Makefile $(OBJS)
|
||||
gfortran $(GFOPT) $< $(OBJS) -o $@
|
||||
|
||||
# ---------------------------------------------
|
@ -1,65 +0,0 @@
|
||||
module fraktals
|
||||
implicit none
|
||||
contains
|
||||
|
||||
!-----------------------------------------------------
|
||||
subroutine simple_julia(pic, cx, cy, maxiter)
|
||||
implicit none
|
||||
integer, intent(inout), dimension (:,:) :: pic
|
||||
real, intent(in) :: cx, cy
|
||||
integer, intent(in) :: maxiter
|
||||
|
||||
integer :: ix, iy, width, height
|
||||
real :: fx, fy
|
||||
complex :: Z, C
|
||||
integer :: iter
|
||||
|
||||
width = ubound(pic, 1)
|
||||
height = ubound(pic, 2)
|
||||
! print *, "image size : ", width, height
|
||||
! print *, "constante : ", cx, cy
|
||||
|
||||
C = complex(cx, cy)
|
||||
! print *, "C = ", C
|
||||
|
||||
do ix = 1, width
|
||||
fx = (float(ix) / (float(width)/4.0) - 2.0)
|
||||
do iy = 1, height
|
||||
fy = (float(iy) / (float(height)/4.0) - 2.0)
|
||||
|
||||
! ------ traitement du pixel
|
||||
iter = 0
|
||||
Z = complex(fx, fy)
|
||||
do while ( (modulus2(Z) .LT. 4.0) .AND. &
|
||||
(iter < maxiter) )
|
||||
Z = (Z * Z) + C
|
||||
iter = iter + 1
|
||||
|
||||
end do
|
||||
|
||||
pic(ix, iy) = iter
|
||||
|
||||
! print *, ix, iy, " ", fx, fy, " ", iter
|
||||
|
||||
enddo
|
||||
enddo
|
||||
|
||||
end subroutine
|
||||
!-----------------------------------------------------
|
||||
function dist0 (x, y)
|
||||
implicit none
|
||||
real, intent(in) :: x, y
|
||||
real :: dist0
|
||||
dist0 = ( x*x + y*y )
|
||||
end function
|
||||
|
||||
!-----------------------------------------------------
|
||||
function modulus2(pt)
|
||||
implicit none
|
||||
complex, intent(in) :: pt
|
||||
real :: modulus2
|
||||
modulus2 = real(pt)*real(pt) + imag(pt)*imag(pt)
|
||||
end
|
||||
!-----------------------------------------------------
|
||||
|
||||
end module fraktals
|
@ -1,32 +0,0 @@
|
||||
!
|
||||
! this is the main programm
|
||||
!
|
||||
!-----------------------------------------------------
|
||||
|
||||
program julia
|
||||
|
||||
use spitpgm
|
||||
use fraktals
|
||||
|
||||
implicit none
|
||||
|
||||
integer, dimension(640, 480) :: picz
|
||||
integer :: argc
|
||||
character(200) :: filename, string
|
||||
real :: cx, cy
|
||||
|
||||
argc = IARGC()
|
||||
if (3 .NE. argc) then
|
||||
STOP ": JULIA PROGGY NEED PARAMETERS"
|
||||
endif
|
||||
|
||||
call getarg(1, filename)
|
||||
call getarg(2, string) ; read (string, *) cx
|
||||
call getarg(3, string) ; read (string, *) cy
|
||||
|
||||
call simple_julia(picz, cx, cy, 120)
|
||||
call spit_as_pgm_8(picz, trim(filename))
|
||||
|
||||
end program
|
||||
|
||||
!-----------------------------------------------------
|
@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
for foo in $(seq 0 39)
|
||||
do
|
||||
|
||||
img=$(printf "frames/%05d.pgm" $foo)
|
||||
bar=$(echo "$foo / 147.0" | bc -l)
|
||||
cx=$(echo "0.4 * c($foo)" | bc -l)
|
||||
cy=$(echo "0.4 * s($foo*2)" | bc -l)
|
||||
|
||||
./julia $img $cx $cy
|
||||
|
||||
done
|
||||
|
||||
echo ; echo "Encoding, please wait..."
|
||||
|
||||
convert -delay 10 frames/*.pgm foo.gif
|
||||
|
@ -78,7 +78,7 @@ end
|
||||
!
|
||||
! this is the main programm
|
||||
!
|
||||
program mkmandel
|
||||
program image
|
||||
|
||||
use imagetools
|
||||
|
||||
|
@ -1,73 +0,0 @@
|
||||
module spitpgm
|
||||
|
||||
implicit none
|
||||
|
||||
contains
|
||||
|
||||
!-----------------------------------------------------
|
||||
|
||||
subroutine spit_as_pgm(pic, fname)
|
||||
|
||||
integer, intent(in), dimension (:,:) :: pic
|
||||
character (len=*), intent(in) :: fname
|
||||
|
||||
integer :: io, foo
|
||||
integer :: ix, iy
|
||||
real :: fk, fpix
|
||||
|
||||
print *, "> spit_as_pgm to ", fname
|
||||
|
||||
open(newunit=io, file=fname)
|
||||
write (io, '(a2)') "P2"
|
||||
write (io, '(i0," ",i0)') size(pic, 1), size(pic, 2)
|
||||
write (io, '(i0)') 65535
|
||||
|
||||
foo = MAXVAL(pic)
|
||||
if (foo .EQ. 0) then
|
||||
print *, " IS SOMETHING WRONG GOING TO HAPPEN ?"
|
||||
do ix = 1, size(pic)
|
||||
write (io, "(i0)") 0
|
||||
enddo
|
||||
else
|
||||
fk = float(foo) / 65535.0
|
||||
print *, " max pix value", foo, " fk = ", fk
|
||||
do iy = 1, ubound(pic, 2)
|
||||
do ix = 1, ubound(pic, 1)
|
||||
fpix = float(pic(ix, iy)) / fk
|
||||
write (io, "(i0)") int(fpix)
|
||||
end do
|
||||
end do
|
||||
endif
|
||||
close(io)
|
||||
|
||||
end subroutine
|
||||
!-----------------------------------------------------
|
||||
subroutine spit_as_pgm_8(pic, fname)
|
||||
|
||||
integer, intent(in), dimension (:,:) :: pic
|
||||
character (len=*), intent(in) :: fname
|
||||
|
||||
integer :: io, foo
|
||||
integer :: ix, iy
|
||||
|
||||
print *, "> spit_as_pgm_8 to ", fname
|
||||
foo = MAXVAL(pic)
|
||||
print *, " max = ", foo
|
||||
open(newunit=io, file=fname)
|
||||
write (io, '(a2)') "P2"
|
||||
write (io, '(i0," ",i0)') size(pic, 1), size(pic, 2)
|
||||
write (io, '(i0)') 255
|
||||
|
||||
do iy=1,ubound(pic, 2)
|
||||
do ix=1, ubound(pic, 1)
|
||||
foo = pic(ix, iy)
|
||||
if (foo .GT. 255) foo = 255
|
||||
write(io, "(i3)") foo
|
||||
enddo
|
||||
enddo
|
||||
close(io)
|
||||
|
||||
end subroutine
|
||||
!-----------------------------------------------------
|
||||
|
||||
end module spitpgm
|
@ -17,7 +17,7 @@ fprintf(stderr, " +-- sf info [%s] %p\n", text, psf);
|
||||
|
||||
fprintf(stderr, " | samplerate %d\n", psf->samplerate);
|
||||
fprintf(stderr, " | channels %d\n", psf->channels);
|
||||
fprintf(stderr, " | frames %ld\n", psf->frames);
|
||||
fprintf(stderr, " | frames %d\n", psf->frames);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user