From c55a7460e0c45e22d6f70bbf3587f9b08879a151 Mon Sep 17 00:00:00 2001 From: tTh Date: Thu, 15 Dec 2022 15:03:37 +0100 Subject: [PATCH] make an image_map added to the code --- GravityField/.gitignore | 1 + GravityField/Makefile | 3 ++- GravityField/animation.f90 | 14 ++++++++------ GravityField/essai.f90 | 2 +- GravityField/raytrace.sh | 2 ++ 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/GravityField/.gitignore b/GravityField/.gitignore index c25de89..f3f8336 100644 --- a/GravityField/.gitignore +++ b/GravityField/.gitignore @@ -20,4 +20,5 @@ WS/data/* foo.pgm bar.pgm +planets.txt diff --git a/GravityField/Makefile b/GravityField/Makefile index f3a654f..7fcab29 100644 --- a/GravityField/Makefile +++ b/GravityField/Makefile @@ -2,7 +2,7 @@ # Fortraneries by tTh - Gravity Field # -GFOPT = -Wall -Wextra -g -time -I../Modules +GFOPT = -Wall -Wextra -g -pg -time -I../Modules MODOBJ = ../Modules/spitpgm.o all: essai animation @@ -20,3 +20,4 @@ essai: essai.f90 Makefile realfield.o animation: animation.f90 Makefile realfield.o gfortran $(GFOPT) $< realfield.o $(MODOBJ) -o $@ +#- diff --git a/GravityField/animation.f90 b/GravityField/animation.f90 index 3abe0d0..a2d84b1 100644 --- a/GravityField/animation.f90 +++ b/GravityField/animation.f90 @@ -6,13 +6,15 @@ program animation use realfield - use spitpgm + + use spitpgm ! extern module + implicit none ! some configuration constants integer, parameter :: S_WIDTH = 1024 integer, parameter :: S_HEIGHT = 1024 - integer, parameter :: NB_BODY = 50 + integer, parameter :: NB_BODY = 51 !!! WARNING : global variable !!! type(massbody) :: planets(NB_BODY) @@ -92,7 +94,7 @@ subroutine make_color_map(moons, fname, width, height) ! loop over all the planet's bodies do ipl=1, ubound(moons, 1) - ! compute the "fake" distance + ! compute the pseudo distance dx = fx - moons(ipl)%posx dy = fy - moons(ipl)%posy 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 endif - moons(foo)%heading = moons(foo)%heading + (0.73*(rand()-0.50)) - if (moons(foo)%heading .GT. 6.2831853) moons(foo)%heading = 0.0 - if (moons(foo)%heading .LT. 0.0000001) moons(foo)%heading = 0.0 + moons(foo)%heading = moons(foo)%heading + (0.78*(rand()-0.50)) + if (moons(foo)%heading .GT. 6.283185307) moons(foo)%heading = 0.0 + if (moons(foo)%heading .LT. 0.000000001) moons(foo)%heading = 0.0 enddo diff --git a/GravityField/essai.f90 b/GravityField/essai.f90 index 4bf5ea4..27b2d4b 100644 --- a/GravityField/essai.f90 +++ b/GravityField/essai.f90 @@ -11,7 +11,7 @@ program essai call init_random() - call essai_near_planet(9999, 4096) + call essai_near_planet(256, 1024) STOP 'BECAUSE YOLO' diff --git a/GravityField/raytrace.sh b/GravityField/raytrace.sh index 6e2fdcb..59a2945 100755 --- a/GravityField/raytrace.sh +++ b/GravityField/raytrace.sh @@ -37,6 +37,8 @@ convert ${TMPF} \ # --------------------------------------- +# main loop, build all that nice picz + for foo in $(seq 0 1999) do echo '............' $foo