GrafAnim: made the testbed

This commit is contained in:
tTh 2022-11-13 23:47:45 +01:00
parent 25b2f353cd
commit 17e5de3ecb
7 changed files with 85 additions and 8 deletions

4
GrafAnim/.gitignore vendored
View File

@ -1,3 +1,7 @@
essai essai
*.scratch
*.tga
F/*.tga
*.gif

3
GrafAnim/F/README.md Normal file
View File

@ -0,0 +1,3 @@
# This is juste a workspace

View File

@ -2,7 +2,7 @@
# Fortraneries by tTh - Graf Anim # Fortraneries by tTh - Graf Anim
# #
GFOPT = -Wall -Wextra -g -time GFOPT = -Wall -Wextra -g -time
essai: essai.f90 usegenplot.o Makefile essai: essai.f90 usegenplot.o Makefile
gfortran $(GFOPT) $< usegenplot.o -o $@ gfortran $(GFOPT) $< usegenplot.o -o $@

View File

@ -1,5 +1,6 @@
# GrafAnim # GrafAnim
Quelques essais approximatifs pour faire des graphiques inutiles, 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.

View File

@ -1,13 +1,43 @@
program essai program essai
use usegenplot use usegenplot
implicit none 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 end program

View File

@ -4,3 +4,14 @@ set -e
make essai 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

View File

@ -7,9 +7,37 @@ module usegenplot
subroutine init_genplot(filename) 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 end subroutine