diff --git a/GrafAnim/.gitignore b/GrafAnim/.gitignore index 3f5b0b4..1558a08 100644 --- a/GrafAnim/.gitignore +++ b/GrafAnim/.gitignore @@ -1,3 +1,7 @@ essai +*.scratch +*.tga +F/*.tga +*.gif diff --git a/GrafAnim/F/README.md b/GrafAnim/F/README.md new file mode 100644 index 0000000..732aad1 --- /dev/null +++ b/GrafAnim/F/README.md @@ -0,0 +1,3 @@ + +# This is juste a workspace + diff --git a/GrafAnim/Makefile b/GrafAnim/Makefile index d6fbd53..bb5ea2b 100644 --- a/GrafAnim/Makefile +++ b/GrafAnim/Makefile @@ -2,7 +2,7 @@ # Fortraneries by tTh - Graf Anim # -GFOPT = -Wall -Wextra -g -time +GFOPT = -Wall -Wextra -g -time essai: essai.f90 usegenplot.o Makefile gfortran $(GFOPT) $< usegenplot.o -o $@ diff --git a/GrafAnim/README.md b/GrafAnim/README.md index 8ffac47..3e3abd7 100644 --- a/GrafAnim/README.md +++ b/GrafAnim/README.md @@ -1,5 +1,6 @@ # GrafAnim Quelques essais approximatifs pour faire des graphiques inutiles, -dans une démarche mettant en avant la techno-futilité +dans une démarche mettant en avant la techno-futilité, une notion +bien définie par le collectif Interhack. diff --git a/GrafAnim/essai.f90 b/GrafAnim/essai.f90 index 95c67df..1293cae 100644 --- a/GrafAnim/essai.f90 +++ b/GrafAnim/essai.f90 @@ -1,13 +1,43 @@ program essai - use usegenplot implicit none - ! integer :: foo, bar + integer :: foo, bar + integer :: nbarg + integer :: numframe = 1 + character(len=32) :: arg - write(0, *) "------------ essai graf anim ---------------" + ! write(0, *) "------------ essai graf anim ---------------" - call init_genplot('essai.genplot') + nbarg = IARGC() + if (nbarg .GT. 0) then + call GETARG(1, arg) + write (0, '(A40, A5)') "argument = ", arg + read (arg, *) numframe + endif + + write(0, '(A40, I5)') "frame number =", numframe + + call init_genplot("essai.genplot") + ! call do_frame(7) + + bar = (numframe * 20) - 160 + do foo=20, 620, 40 + call gplt_line(foo, 20, bar, 460) + call gplt_line(bar, 20, foo, 460) + enddo + +contains !------------------------------------------ + +subroutine do_frame(color) + integer, intent(in) :: color + + call gplt_line( 0, 0, 640, 0) + call gplt_line( 0, 480, 640, 480) + call gplt_line( 0, 0, 0, 480) + call gplt_line(640, 0, 640, 480) + +end subroutine end program diff --git a/GrafAnim/go.sh b/GrafAnim/go.sh index eb622cd..d998bc8 100755 --- a/GrafAnim/go.sh +++ b/GrafAnim/go.sh @@ -4,3 +4,14 @@ set -e make essai +for foo in $(seq 0 89) +do + ./essai $foo > a.scratch + fname=$(printf "F/%04d.tga" $foo) + echo $fname + genplot2 a.scratch $fname + +done + +convert -delay 10 F/????.tga foo.gif + diff --git a/GrafAnim/usegenplot.f90 b/GrafAnim/usegenplot.f90 index 2e5d24a..0691519 100644 --- a/GrafAnim/usegenplot.f90 +++ b/GrafAnim/usegenplot.f90 @@ -7,9 +7,37 @@ module usegenplot subroutine init_genplot(filename) - character(200) :: filename + character(*), intent(in) :: filename - write(0, *) '-------- init genplot ' + write(0, *) '--> init genplot "', filename, '"' + +end subroutine + +! ------------------------------------------------------------------- + +subroutine gplt_move(x, y) + integer, intent(in) :: x, y + print *, x, y, 0 +end subroutine + +! ------------------------------------------------------------------- + +subroutine gplt_draw(x, y) + integer, intent(in) :: x, y + print *, x, y, 2 +end subroutine + +! ------------------------------------------------------------------- + +subroutine gplt_line(x1, y1, x2, y2) + integer, intent(in) :: x1, y1, x2, y2 + call gplt_move(x1, y1) + call gplt_draw(x2, y2) +end subroutine + +! ------------------------------------------------------------------- +subroutine gplt_rect(x1, y1, x2, y2) + integer, intent(in) :: x1, y1, x2, y2! ------------------------------------------------------------------- end subroutine