GrafAnim: made the testbed
This commit is contained in:
parent
25b2f353cd
commit
17e5de3ecb
4
GrafAnim/.gitignore
vendored
4
GrafAnim/.gitignore
vendored
@ -1,3 +1,7 @@
|
||||
|
||||
essai
|
||||
|
||||
*.scratch
|
||||
*.tga
|
||||
F/*.tga
|
||||
*.gif
|
||||
|
3
GrafAnim/F/README.md
Normal file
3
GrafAnim/F/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
# This is juste a workspace
|
||||
|
@ -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 $@
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user