Compare commits
No commits in common. "87191666b4659ddb5d13d9899048a9bc2d6a7a20" and "8223cb8e77464da920567f94490b00b3f54625d8" have entirely different histories.
87191666b4
...
8223cb8e77
6
GrafAnim/.gitignore
vendored
6
GrafAnim/.gitignore
vendored
@ -1,14 +1,8 @@
|
||||
|
||||
essai
|
||||
doubledice
|
||||
doublegauss
|
||||
trigofest
|
||||
|
||||
*.scratch
|
||||
*.genplot
|
||||
*.tga
|
||||
F/*.tga
|
||||
*.gif
|
||||
*.pnm
|
||||
*.pgm
|
||||
|
||||
|
@ -2,33 +2,14 @@
|
||||
# Fortraneries by tTh - Graf Anim
|
||||
#
|
||||
|
||||
GFOPT = -Wall -Wextra -g -time -I../Modules
|
||||
|
||||
# ---- programmes
|
||||
GFOPT = -Wall -Wextra -g -time
|
||||
|
||||
essai: essai.f90 usegenplot.o Makefile
|
||||
gfortran $(GFOPT) $< usegenplot.o -o $@
|
||||
|
||||
doubledice: doubledice.f90 Makefile \
|
||||
utils_ga.o usegenplot.o
|
||||
gfortran $(GFOPT) $< usegenplot.o utils_ga.o -o $@
|
||||
|
||||
doublegauss: doublegauss.f90 Makefile utils_ga.o
|
||||
gfortran $(GFOPT) $< ../Modules/pixrgb.o utils_ga.o -o $@
|
||||
|
||||
trigofest: trigofest.f90 Makefile vue3axes.o utils_ga.o
|
||||
gfortran $(GFOPT) $< ../Modules/pixrgb.o ../Modules/spitpgm.o \
|
||||
utils_ga.o -o $@
|
||||
|
||||
# ---- modules locaux
|
||||
doubledice: doubledice.f90 usegenplot.o Makefile
|
||||
gfortran $(GFOPT) $< usegenplot.o -o $@
|
||||
|
||||
usegenplot.o: usegenplot.f90 Makefile
|
||||
gfortran $(GFOPT) -c $<
|
||||
|
||||
utils_ga.o: utils_ga.f90 Makefile
|
||||
gfortran $(GFOPT) -c $<
|
||||
|
||||
vue3axes.o: vue3axes.f90 Makefile
|
||||
gfortran $(GFOPT) -c $<
|
||||
|
||||
|
||||
|
@ -4,19 +4,3 @@ Quelques essais approximatifs pour faire des graphiques inutiles,
|
||||
dans une démarche mettant en avant la techno-futilité, une notion
|
||||
bien définie par le collectif Interhack.
|
||||
|
||||
Actuellement, certains des logiciels que vous voyez ici utilisent un backend
|
||||
graphique brassé à la maison et nommé `genplot2`. Hélas, celui-ci est
|
||||
un peu foireux sur les tracés de ligne...
|
||||
|
||||
|
||||
## trigofest
|
||||
|
||||
Distorsions approximatives de la courbe de Lissajous.
|
||||
|
||||
## doubledice
|
||||
|
||||
Ou comment dessiner des gaussiennes.
|
||||
|
||||
## vue3axes
|
||||
|
||||
Un module assez spécialisé
|
||||
|
@ -1,128 +0,0 @@
|
||||
program trigofest
|
||||
|
||||
!-
|
||||
! ces divagations me viennent de superbes codes en Processing
|
||||
! allez visiter https://bleuje.com/tutorial1/ c'est d'la balle
|
||||
!-
|
||||
|
||||
use spitpgm ! in ../Modules
|
||||
implicit none
|
||||
|
||||
integer, dimension(:,:), allocatable :: picz
|
||||
integer :: W, H
|
||||
integer :: errcode
|
||||
integer :: loop
|
||||
character(200) :: filename
|
||||
real :: blouber
|
||||
!-------------------------------------------------------------
|
||||
|
||||
W = 512 ; H = 342
|
||||
allocate(picz(W,H), stat=errcode)
|
||||
|
||||
blouber = 0.1
|
||||
do loop=0, 359
|
||||
call spirale(picz, blouber, loop*9)
|
||||
blouber = blouber + 0.3333
|
||||
write (filename, "(a, i5.5, a)") "F/spi/", loop, ".pgm"
|
||||
call spit_as_pgm_8(picz, trim(filename))
|
||||
print *, loop, blouber
|
||||
enddo
|
||||
|
||||
deallocate(picz)
|
||||
|
||||
STOP ': WORLD FINISHED'
|
||||
|
||||
contains !------------------------------------------
|
||||
!-------------------------------------------------------------
|
||||
! Lowlevel functions
|
||||
! ------------------
|
||||
|
||||
subroutine plot_a_dot(pic, ix, iy, val)
|
||||
implicit none
|
||||
integer, dimension(:,:), intent(out) :: pic
|
||||
integer, intent(in) :: ix, iy, val
|
||||
|
||||
integer :: lx, ly, ux, uy
|
||||
|
||||
lx = lbound(pic, 1) ; ux = ubound(pic, 1)
|
||||
ly = lbound(pic, 2) ; uy = ubound(pic, 2)
|
||||
|
||||
! write(0, *) 'plot dot ' , ix, iy
|
||||
! write(0, *) ' X size ' , lx, ux
|
||||
! write(0, *) ' Y size ' , ly, uy
|
||||
|
||||
if ( ix .LT. lx ) then
|
||||
! write(0, *) 'UNDER, IX', ix, 'LX', lx
|
||||
! STOP ': UNDER ZERO'
|
||||
return
|
||||
endif
|
||||
if ( ix .GT. ux ) then
|
||||
! write(0, *) 'OVER, IX', ix, 'UX', ux
|
||||
! STOP ': OVER9000 '
|
||||
return
|
||||
endif
|
||||
|
||||
if ( iy .LT. ly ) then
|
||||
! write(0, *) 'UNDER, IY', iy, 'LY', ly
|
||||
! STOP ': UNDER ZERO'
|
||||
return
|
||||
endif
|
||||
if ( iy .GT. uy ) then
|
||||
! write(0, *) 'OVER, IY', iy, 'UY', uy
|
||||
! STOP ': OVER9000 '
|
||||
return
|
||||
endif
|
||||
|
||||
if ( (val .LT. 0) .OR. (val .GT. 255) ) then
|
||||
write(0, *) 'VAL = ', val
|
||||
STOP ': BAD PIXEL VALUE'
|
||||
endif
|
||||
|
||||
pic(ix, iy) = val
|
||||
|
||||
end subroutine
|
||||
|
||||
!-------------------------------------------------------------
|
||||
! La premirere spirale
|
||||
! --------------------
|
||||
|
||||
subroutine spirale(pic, inirad, param)
|
||||
implicit none
|
||||
integer, dimension(:,:), intent(out) :: pic
|
||||
real, intent(in) :: inirad
|
||||
integer, intent(in) :: param
|
||||
|
||||
real :: angle, radius, rx, ry
|
||||
real :: kx, ky
|
||||
integer :: foo, ix, iy
|
||||
|
||||
pic = 0 ! clear the picture
|
||||
|
||||
radius = inirad
|
||||
|
||||
do foo=0, 360*15
|
||||
angle = real(foo) * 0.01745329252
|
||||
|
||||
! rx = radius * sin(angle) * 1.21
|
||||
kx = 1.55 * sin(angle+(0.04*radius))
|
||||
rx = radius * kx
|
||||
|
||||
! ry = radius * cos(angle)
|
||||
ky = cos(angle) + (0.5*cos(angle*6.0))
|
||||
ry = radius * ky
|
||||
radius = radius + 0.0245
|
||||
ix = int(rx) + W/2
|
||||
iy = int(ry) + H/2
|
||||
|
||||
! print *, foo, ix, iy
|
||||
call plot_a_dot(picz, ix, iy, 255-mod(foo+param, 255));
|
||||
|
||||
enddo
|
||||
|
||||
end subroutine
|
||||
|
||||
!-------------------------------------------------------------
|
||||
!-------------------------------------------------------------
|
||||
|
||||
end program
|
||||
|
Loading…
Reference in New Issue
Block a user