make an image_map added to the code

This commit is contained in:
tTh 2022-12-15 15:03:37 +01:00
parent 793ea535a9
commit c55a7460e0
5 changed files with 14 additions and 8 deletions

View File

@ -20,4 +20,5 @@ WS/data/*
foo.pgm foo.pgm
bar.pgm bar.pgm
planets.txt

View File

@ -2,7 +2,7 @@
# Fortraneries by tTh - Gravity Field # Fortraneries by tTh - Gravity Field
# #
GFOPT = -Wall -Wextra -g -time -I../Modules GFOPT = -Wall -Wextra -g -pg -time -I../Modules
MODOBJ = ../Modules/spitpgm.o MODOBJ = ../Modules/spitpgm.o
all: essai animation all: essai animation
@ -20,3 +20,4 @@ essai: essai.f90 Makefile realfield.o
animation: animation.f90 Makefile realfield.o animation: animation.f90 Makefile realfield.o
gfortran $(GFOPT) $< realfield.o $(MODOBJ) -o $@ gfortran $(GFOPT) $< realfield.o $(MODOBJ) -o $@
#-

View File

@ -6,13 +6,15 @@
program animation program animation
use realfield use realfield
use spitpgm
use spitpgm ! extern module
implicit none implicit none
! some configuration constants ! some configuration constants
integer, parameter :: S_WIDTH = 1024 integer, parameter :: S_WIDTH = 1024
integer, parameter :: S_HEIGHT = 1024 integer, parameter :: S_HEIGHT = 1024
integer, parameter :: NB_BODY = 50 integer, parameter :: NB_BODY = 51
!!! WARNING : global variable !!! !!! WARNING : global variable !!!
type(massbody) :: planets(NB_BODY) type(massbody) :: planets(NB_BODY)
@ -92,7 +94,7 @@ subroutine make_color_map(moons, fname, width, height)
! loop over all the planet's bodies ! loop over all the planet's bodies
do ipl=1, ubound(moons, 1) do ipl=1, ubound(moons, 1)
! compute the "fake" distance ! compute the pseudo distance
dx = fx - moons(ipl)%posx dx = fx - moons(ipl)%posx
dy = fy - moons(ipl)%posy dy = fy - moons(ipl)%posy
curdist = (dx*dx) + (dy*dy) curdist = (dx*dx) + (dy*dy)
@ -155,9 +157,9 @@ subroutine deplace_les_planetes(moons, clipit)
if (moons(foo)%posy .LT. EE) moons(foo)%posy = SH if (moons(foo)%posy .LT. EE) moons(foo)%posy = SH
endif endif
moons(foo)%heading = moons(foo)%heading + (0.73*(rand()-0.50)) moons(foo)%heading = moons(foo)%heading + (0.78*(rand()-0.50))
if (moons(foo)%heading .GT. 6.2831853) moons(foo)%heading = 0.0 if (moons(foo)%heading .GT. 6.283185307) moons(foo)%heading = 0.0
if (moons(foo)%heading .LT. 0.0000001) moons(foo)%heading = 0.0 if (moons(foo)%heading .LT. 0.000000001) moons(foo)%heading = 0.0
enddo enddo

View File

@ -11,7 +11,7 @@ program essai
call init_random() call init_random()
call essai_near_planet(9999, 4096) call essai_near_planet(256, 1024)
STOP 'BECAUSE YOLO' STOP 'BECAUSE YOLO'

View File

@ -37,6 +37,8 @@ convert ${TMPF} \
# --------------------------------------- # ---------------------------------------
# main loop, build all that nice picz
for foo in $(seq 0 1999) for foo in $(seq 0 1999)
do do
echo '............' $foo echo '............' $foo