begin of a new era, maybe

This commit is contained in:
tth
2022-03-31 22:14:11 +02:00
parent c47bcfe298
commit 595c6901c9
19 changed files with 208 additions and 274 deletions

View File

@@ -33,5 +33,5 @@ Generally writen as a *sequencial unformated* file.
- Voir de près le calcul du cadrage
- Rajouter des formules
- Ne pas procastiner
- Ne pas procastiner sur le reste

View File

@@ -1,6 +1,7 @@
!
! this is the main programm
!
!-----------------------------------------------------
! JULIA
! =====
! this is the main program
!-----------------------------------------------------
program julia
@@ -24,7 +25,7 @@ program julia
call getarg(2, string) ; read (string, *) cx
call getarg(3, string) ; read (string, *) cy
call simple_julia(picz, cx, cy, 250)
call simple_julia(picz, cx, cy, 2500)
call spit_as_pgm_8(picz, trim(filename))
end program

View File

@@ -14,13 +14,13 @@ fi
#
# run the prog
#
for foo in $(seq 0 39)
for foo in $(seq 0 99)
do
img=$(printf "frames/%05d.pgm" $foo)
img=$(printf "frames/julia/%05d.pgm" $foo)
bar=$(echo "$foo / 247.0" | bc -l)
cx=$(echo "0.4 * c($foo)" | bc -l)
cy=$(echo "0.4 * s($foo*2)" | bc -l)
cx=$(echo "0.3 * c($foo/3)" | bc -l)
cy=$(echo "0.3 * s($foo/2)" | bc -l)
./julia $img $cx $cy
@@ -28,5 +28,6 @@ done
echo ; echo "Encoding, please wait..."
convert -delay 10 frames/*.pgm foo.gif
convert -delay 10 frames/julia/*.pgm foo.gif
animate foo.gif &

View File

@@ -24,11 +24,12 @@ union {
// --------------------------------------------------------------
#declare TS = 0.017;
#declare TS = 0.025;
#declare Truc = object
{
box { <-TS, -TS, -TS>, <TS, TS, TS> }
// box { <-TS, -TS, -TS>, <TS, TS, TS> }
sphere { <0, 0, 0>, TS*0.83 }
}
#include "WS/pickover.inc"
@@ -57,7 +58,7 @@ object {
plane {
<0, 1, 0>, 0
texture {
pigment { color srgb <0.133, 0.155, 0.111> }
pigment { color srgb <0.233, 0.155, 0.191> }
finish { phong 0.18 metallic 0.55 }
}
}
@@ -65,18 +66,18 @@ plane {
// ----------------------------------------------------------
light_source { <-12, 17, -11> color Gray90 }
light_source { <-11, 11, 9> color Gray60 }
light_source { <-12, 15, -11> color Gray90 }
light_source { < 11, 11, 13> color Gray60 }
#declare XCAM = -3.8;
#declare XCAM = -3.1;
#declare YCAM = 3;
#declare ZCAM = 2.1;
#declare ZCAM = 1.9;
camera {
location <XCAM, YCAM, ZCAM>
look_at <0, 2.09, 0>
right x*image_width/image_height
angle 92
angle 82
}
// ----------------------------------------------------------

View File

@@ -1,12 +1,20 @@
#!/bin/bash
POVOPT=" -d +q9 +a +W1920 +H1080 -v +WT4"
PASS=600
POVOPT=" -d +q9 +a +W1280 +H1024 -v +WT2"
PASS=999
ERR="/tmp/pov.error"
POVINC="WS/pickover.inc"
TMPF="/dev/shm/pickover.png"
make pickover
if [ $? -ne 0 ] ; then
echo
echo "Make error " $?
exit 1
fi
./pickover foo.pgm | awk -f pick2pov.awk > $POVINC
head $POVINC
# head $POVINC
for pass in $(seq 0 $(( PASS-1 )) )
do
@@ -16,18 +24,24 @@ do
povray -ipick3d.pov -K${pass} \
Declare=NBPASS=${PASS} \
$POVOPT -O${dstname} 2> $ERR
$POVOPT -O${TMPF} 2> $ERR
if [ $? -ne 0 ]
then
tail $ERR
tail -20 $ERR
exit
fi
sleep 16
convert ${TMPF} \
-fill Gray50 \
-gravity South-West \
-pointsize 24 \
-annotate +20+10 "tTh" \
$dstname
sleep 10
done
ffmpeg -nostdin \
-loglevel warning \
-y -r 25 -f image2 -i frames/pick3d/%05d.png \

View File

@@ -33,11 +33,11 @@ program pickover
STOP " : NO ENOUGH MEMORY"
endif
coefs(1) = 2.24 ; coefs(2) = 0.43
coefs(3) = -0.65 ; coefs(4) = -2.43
coefs(1) = 2.24 ; coefs(2) = 0.43
coefs(3) = -0.65 ; coefs(4) = -2.43
call compute_pickover(points, coefs)
call list_points3d(points, 2, 42000)
call list_points3d(points, 200, 15000)
end program

View File

@@ -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
write(0, '(1X, A)') "> spit_as_pgm to " // trim(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
! XXX print *, "> spit_as_pgm_8 to ", fname
foo = MAXVAL(pic)
! XXX 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

47
Fraktalism/voxelize.f90 Normal file
View File

@@ -0,0 +1,47 @@
!-----------------------------------------------------
! VOXELIZE
! ========
! this is the main program
!-----------------------------------------------------
program voxelize
use fraktals
integer, parameter :: DIM = 500
integer, dimension(:,:,:), allocatable :: cube
type(t_point3d), dimension(:), allocatable :: points
integer :: errcode, foo
integer :: ix, iy, iz
double precision, dimension(4) :: coefs
foo = (DIM*DIM*DIM) / (1024)
PRINT *, "memory request for cube (in Kwords) ", foo
allocate (cube(DIM,DIM,DIM), stat=errcode)
if (0 .NE. errcode) then
STOP " : NO ENOUGH MEMORY FOR CUBE"
endif
nbr_points = 99999
allocate(points(nbr_points), stat=errcode)
if (0 .NE. errcode) then
STOP " : NO ENOUGH MEMORY FOR POINTS"
endif
coefs(1) = 2.24 ; coefs(2) = 0.43
coefs(3) = -0.65 ; coefs(4) = -2.43
call compute_pickover(points, coefs)
call clear_cube(cube)
do foo=1, nbr_points
ix = nint(points(foo)%x * dble(DIM))
iy = nint(points(foo)%y * dble(DIM))
iz = nint(points(foo)%z * dble(DIM))
enddo
!-----------------------------------------------------
contains
!-----------------------------------------------------
!-----------------------------------------------------
end program voxelize
!-----------------------------------------------------