Compare commits

..

No commits in common. "e71084260a200e9946ffec00ab87d3a888d64569" and "0d79c3d7c70d73b132a98dbe987918e37539ed0b" have entirely different histories.

9 changed files with 25 additions and 256 deletions

View File

@ -4,7 +4,6 @@ pickover
lorentz lorentz
voxelize voxelize
evolvopick evolvopick
henon
WS/*.dat WS/*.dat
WS/*.txt WS/*.txt

View File

@ -18,9 +18,6 @@ OBJS = mods/spitpgm.o mods/points3d.o fraktals.o
# --------------------------------------------- # ---------------------------------------------
henon: henon.f90 Makefile $(OBJS)
gfortran $(GFOPT) $< $(OBJS) -o $@
julia: julia.f90 Makefile $(OBJS) julia: julia.f90 Makefile $(OBJS)
gfortran $(GFOPT) $< $(OBJS) -o $@ gfortran $(GFOPT) $< $(OBJS) -o $@

View File

@ -1,4 +1,4 @@
POVOPT=" -d +q9 -a +W1920 +H1080 -v +WT4" POVOPT=" -d +q9 +a +W1024 +H768 -v +WT4"

View File

@ -1,67 +0,0 @@
program henon
implicit none
integer :: passe
double precision :: vx, vy
integer :: w, h
integer :: foo, bar
double precision :: px, py
w = 2000 ; h=1600
write(0, *) "###### Mapping of Henon "
do foo=1, 16
px = dble(foo) / 16.0
do bar=1,16
py = dble(bar) / 16.0
call compute_pixel_henon(px, py, 1700, &
passe, dble(0.5), vx, vy)
write(0, fmt=*) "passe ", passe, vx, vy
enddo
end do
!-----------------------------------------------------
contains
!-----------------------------------------------------
!-----------------------------------------------------
subroutine compute_pixel_henon(a, b, maxpasse, passe, limit, rx, ry)
implicit none
double precision, intent(in) :: a, b, limit
integer, intent(in) :: maxpasse
integer, intent(out) :: passe
double precision, intent(out) :: rx, ry
double precision :: x, y, x2, y2
write(0, fmt="('compute pixel:', (2F8.3, I6, F8.3))") &
a, b, maxpasse, limit
x = 0.0
y = 0.0
do passe=1, maxpasse
x2 = 1d0 + y - (a * x * x)
y2 = b * x
x = x2
y = y2
write(0, fmt="(i4, 2F8.3)") passe, x, y
if (x .lt. -limit) exit
if (x .gt. limit) exit
if (y .lt. -limit) exit
if (y .gt. limit) exit
enddo
rx = x
ry = y
end subroutine
!-----------------------------------------------------
end program

View File

@ -1,149 +0,0 @@
c----------------------------------------------------------------
c *****************************************
c * THIS FILE IS ARCHIVED FOR HISTORY *
c * DON'T TRY TO USE IT AT HOME *
c *****************************************
c----------------------------------------------------------------
c mapping of the Henon Diagram
c a escape time fractal from 'Oulala Software'
c http://www.chez.com/oulala/g77/map_henon.html
c
c----------------------------------------------------------------
program map_henon
c
c control the image dimension
c
integer w, h
parameter (w=2000, h=1600)
c maximum number of iterations by pixel
c around 5000 seems a good value
c
integer maxpasse
parameter (maxpasse=17000)
double precision amp, limite
parameter (amp=1.42d0, limite=4.0d9)
c control the position of the view window
c
double precision a, b
parameter (a=0.65d0, b=0.15d0)
integer x, y, image, passe
integer masque, flag
integer valr, valg, valb
integer in, out
double precision dx, dy, rx, ry
double precision minrx, minry, maxrx, maxry
real temps
integer IMG_CREATE
c ---------------------------------------------------------
image = IMG_CREATE(w, h, 3)
masque = IMG_CREATE(w, h, 3)
in = 0
out = 0
minrx = -9d99
minry = -9d99
maxrx = 9d99
maxry = 9d99
do 5 x=0, w-1
dx = (a-amp) + (amp*2/(w-1)*x)
do 4 y=0, h-1
dy = (b-amp) + (amp*2/(h-1)*y)
call henon(dx, dy, maxpasse, passe, limite, rx, ry)
if (passe .gt. maxpasse) then
in = in + 1
valr = 128
valg = abs(int(rx*1d2))
valb = abs(int(ry*1d2))
flag = 0
else
out = out + 1
if (passe .le. 2) then
valr = 0
valg = 80 * passe
valb = 10
flag = 255
else
valg = (passe*255)/maxpasse
valr = mod(passe,255)
valb = (255-((passe*255)/maxpasse))/3
flag = 128
endif
endif
C write(6,101) x, y, dx, dy, passe, valr, valg, valb, rx, ry
call IMG_PLOT(image, x, y, valr, valg, valb)
call IMG_PLOT(masque, x, y, flag, flag, flag)
4 continue
write(6,107) x, w, in, out
5 continue
c
c Here, you can change the name of the saved TGA file.
c Just modify the second parameter...
c
call IMG_TGA_SA(image, "map_henon.tga", 0)
call IMG_TGA_SA(masque, "msq_henon.tga", 0)
temps = second() / 60.0
write(6,120) temps
101 format(2i4, 2(2x,f9.5), i7, 3(i4), 2(2x,f9.5))
107 format(i5, ' / ', i5, 5x, 2(i12) )
120 format('total time: ', f8.2, ' minutes')
end
c----------------------------------------------------------------
c this subroutine do the iterations
c in pars: a
c b
c maxpasse
c limit
c out pars: passe
c rx
c ry
c
subroutine henon(a, b, maxpasse, passe, limit, rx, ry)
double precision a, b, limit
integer maxpasse, passe
double precision rx, ry
double precision x, x2, y, y2
x = 0
y = 0
do 5 passe=1, maxpasse
x2 = 1d0 + y - a * x * x
y2 = b * x
x = x2
y = y2
if (x .lt. -limit) goto 8
if (x .gt. limit) goto 8
if (y .lt. -limit) goto 8
if (y .gt. limit) goto 8
5 continue
8 continue
rx = x
ry = y
end
c----------------------------------------------------------------

View File

@ -12,36 +12,34 @@ fi
./voxelize > WS/voxels.dat ./voxelize > WS/voxels.dat
./vox2inc.awk < WS/voxels.dat > WS/voxels.inc ./vox2inc.awk < WS/voxels.dat > WS/voxels.inc
grep NbrVox WS/voxels.inc
TMPNG="/dev/shm/voxvidz.png" TMPNG="/dev/shm/voxvidz.png"
NBIMG=360 NBIMG=360
for idx in $( seq 0 $(( NBIMG - 1)) ) for idx in $( seq 0 $(( NBIMG - 1)) )
do do
dst=$(printf "frames/voxel/%05d.png" $idx) dst=$(printf "frames/voxel/%05d.png" $idx)
delta=$( echo "scale=6 ; ${idx}/360" | bc -l) delta=$( echo "scale=3 ; ${idx}/360" | bc -l)
echo "Renderbox work on "$dst" delta = " $delta echo "Renderbox work on " $dst " tu" $delta
povray -ishowvoxels.pov -K$idx ${POVOPT} \ povray -ishowvoxels.pov -K$idx ${POVOPT} \
-O${TMPNG} 2> WS/toto.err -O${TMPNG} 2> WS/toto.err
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
echo "ERROR ERROR ERROR ERROR ERROR ERROR" echo "ERROR ERROR ERROR ERROR"
tail -15 WS/toto.err tail -15 WS/toto.err
sleep 20 sleep 20
#exit 1 #exit 1
fi fi
titre='Voxelisation - tTh - avril 2022' titre='>>> Voxelisation - tTh - avril 2022'
numbers=$(tail -1 WS/camvox.log | \ numbers=$(tail -1 WS/camvox.log | \
awk '{printf " %6.3f %6.3f %6.3f", $1, $2, $3}') awk '{printf ">>> %6.3f %6.3f %6.3f", $1, $2, $3}')
echo "$numbers" echo $numbers
convert ${TMPNG} \ convert ${TMPNG} \
-fill Gray70 \ -fill Cyan \
-kerning 1 \ -kerning 1 \
-pointsize 24 \ -pointsize 16 \
-font AvantGarde-Book \ -font AvantGarde-Book \
-gravity South-West \ -gravity South-West \
-annotate +20+32 "$titre" \ -annotate +20+32 "$titre" \
@ -53,4 +51,4 @@ do
done done
./encode.sh frames/voxel/ voxel-2.mp4 ./encode.sh frames/voxel/ voxel-1.mp4

View File

@ -17,7 +17,7 @@ global_settings {
#declare VOXEL = object #declare VOXEL = object
{ {
// sphere { 0, 1.18 } // sphere { 0, 1.18 }
#local D = 1.0111; #local D = 1.38;
box { <-D, -D, -D>, <D, D, D> } box { <-D, -D, -D>, <D, D, D> }
} }
@ -34,18 +34,18 @@ object {
//---------------------------------------------------------------- //----------------------------------------------------------------
// light_source { <-12, 45, -25> color Gray70 } // light_source { <-12, 45, -25> color Gray70 }
light_source { <-52, 5, -38> color Yellow*0.45 } light_source { <-52, 5, -38> color Yellow*0.55 }
light_source { < 59, 5, 48> color Gray20 } light_source { < 59, 5, 48> color Gray20 }
light_source { < 3, 59, 8> color Red*0.65 } light_source { < 3, -59, 8> color Red*0.75 }
light_source { < 8, -61, 3> color Green*0.75 } light_source { < 8, 61, 3> color Green*0.85 }
#declare NormClock = (clock/360); #declare NormClock = (clock/360);
#declare ECAM = 88 - (73*NormClock); #declare ECAM = 88 - 23*NormClock;
#declare XCAM = ECAM * sin(radians(clock)); #declare XCAM = ECAM * sin(radians(clock));
#declare YCAM = -12; #declare YCAM = -12;
#declare ZCAM = ECAM * cos(radians(clock)); #declare ZCAM = ECAM * cos(radians(clock));
#declare ACAM = 65 + (48*NormClock); #declare ACAM = 65 + (27*NormClock);
#if (0 = clock) #if (0 = clock)
#fopen CL "WS/camvox.log" write #fopen CL "WS/camvox.log" write

View File

@ -9,7 +9,7 @@ BEGIN {
print "union {" print "union {"
} }
$4 > 500 { $4 > 145 {
count = $4 count = $4
value = $5 value = $5
if (count > maxcount) if (count > maxcount)

View File

@ -7,25 +7,23 @@
program voxelize program voxelize
use fraktals use fraktals
implicit none
integer, parameter :: DIM = 100 integer, parameter :: DIM = 100
integer, dimension(:,:,:), allocatable :: cube integer, dimension(:,:,:), allocatable :: cube
type(t_point3d), dimension(:), allocatable :: points type(t_point3d), dimension(:), allocatable :: points
integer :: errcode, foo integer :: errcode, foo
integer :: ix, iy, iz integer :: ix, iy, iz
integer :: nbr_points double precision, dimension(4) :: coefs
double precision, dimension(4) :: coefs, KB
double precision :: dval double precision :: dval
write(0, *) "--- start of voxelize" ! XXX foo = (DIM*DIM*DIM) / (1024)
! XXX PRINT *, "memory request for cube (in Kwords) ", foo
allocate (cube(DIM,DIM,DIM), stat=errcode) allocate (cube(DIM,DIM,DIM), stat=errcode)
if (0 .NE. errcode) then if (0 .NE. errcode) then
STOP " : NO ENOUGH MEMORY FOR CUBE" STOP " : NO ENOUGH MEMORY FOR CUBE"
endif endif
nbr_points = 2800000 nbr_points = 3100000
allocate(points(nbr_points), stat=errcode) allocate(points(nbr_points), stat=errcode)
if (0 .NE. errcode) then if (0 .NE. errcode) then
STOP " : NO ENOUGH MEMORY FOR POINTS" STOP " : NO ENOUGH MEMORY FOR POINTS"
@ -33,10 +31,7 @@ program voxelize
coefs(1) = 2.23 ; coefs(2) = 0.42 coefs(1) = 2.23 ; coefs(2) = 0.42
coefs(3) = -0.64 ; coefs(4) = -2.42 coefs(3) = -0.64 ; coefs(4) = -2.42
call compute_pickover(points, coefs)
KB(1) = 1.51 ; KB(2) = -1.89
KB(3) = 1.69 ; KB(4) = 0.79
call compute_pickover(points, KB)
call clear_cube(cube) call clear_cube(cube)
@ -51,7 +46,7 @@ program voxelize
enddo enddo
dval = DBLE(MAXVAL(cube)) dval = DBLE(MAXVAL(cube))
write(0, *) "--- maximum of the cube= ", dval write(0, *) "--- cube maximum = ", dval
do foo=1, nbr_points do foo=1, nbr_points
call fcoor2icoor(points(foo)%x, ix) call fcoor2icoor(points(foo)%x, ix)
@ -62,9 +57,6 @@ program voxelize
DBLE(cube(ix,iy,iz)) / dval DBLE(cube(ix,iy,iz)) / dval
enddo enddo
dval = DBLE(MAXVAL(cube))
write(0, *) "--- end of voxelize"
!----------------------------------------------------- !-----------------------------------------------------
contains contains
!----------------------------------------------------- !-----------------------------------------------------
@ -84,7 +76,7 @@ subroutine fcoor2icoor(in, out)
if (outvalue .GE. DIM) out = DIM-1 if (outvalue .GE. DIM) out = DIM-1
end subroutine end subroutine
!------------------------------------------------------------ !-----------------------------------------------------
subroutine clear_cube(cube) subroutine clear_cube(cube)
type(integer), dimension(:,:,:), intent(out) :: cube type(integer), dimension(:,:,:), intent(out) :: cube
@ -99,7 +91,7 @@ subroutine clear_cube(cube)
enddo enddo
end subroutine end subroutine
!------------------------------------------------------------ !-----------------------------------------------------
subroutine spit_cube_as_union(fname, datas, notused) subroutine spit_cube_as_union(fname, datas, notused)
character(*) :: fname character(*) :: fname
type(integer), dimension(:,:,:), intent(in) :: datas type(integer), dimension(:,:,:), intent(in) :: datas
@ -114,7 +106,6 @@ subroutine spit_cube_as_union(fname, datas, notused)
STOP ' : SPITUNION : FAIL OPEN OUTPUT FILE' STOP ' : SPITUNION : FAIL OPEN OUTPUT FILE'
endif endif
close(fd) close(fd)
end subroutine end subroutine