hop vendredi, mise en prod

This commit is contained in:
tTh 2022-12-16 21:16:02 +01:00
parent e780a79273
commit a1f5030300
4 changed files with 17 additions and 13 deletions

View File

@ -10,6 +10,7 @@ WS/*/*.gif
WS/data/* WS/data/*
*.pgm *.pgm
*.pnm
*.png *.png
*.gif *.gif
*.log *.log

View File

@ -8,6 +8,7 @@ program animation
use realfield use realfield
use spitpgm ! extern module use spitpgm ! extern module
use pixrgb ! extern module
implicit none implicit none
@ -53,7 +54,7 @@ subroutine la_grande_boucle(start, nbre, moons)
write (filename, "(a, i5.5, a)") 'WS/data/', pass, '.txt' write (filename, "(a, i5.5, a)") 'WS/data/', pass, '.txt'
call save_bodies_to_txt_file (planets, filename) call save_bodies_to_txt_file (planets, filename)
write (filename, "(a, i5.5, a)") 'WS/colmap/', pass, '.pgm' write (filename, "(a, i5.5, a)") 'WS/colmap/', pass, '.pnm'
call make_color_map(planets, filename, S_WIDTH, S_HEIGHT) call make_color_map(planets, filename, S_WIDTH, S_HEIGHT)
enddo enddo
@ -71,7 +72,7 @@ subroutine make_color_map(moons, fname, width, height)
character(len=*), intent(in) :: fname character(len=*), intent(in) :: fname
integer, intent(in) :: width, height integer, intent(in) :: width, height
integer, dimension(:,:), allocatable :: map type(t_pixrgb), dimension(:,:), allocatable :: cmap
integer :: ix, iy, near, ipl integer :: ix, iy, near, ipl
integer :: errcode integer :: errcode
real :: curdist, smalldist real :: curdist, smalldist
@ -80,10 +81,10 @@ subroutine make_color_map(moons, fname, width, height)
write(0, *) "colmap ", ubound(moons, 1), "moons to ", trim(fname) write(0, *) "colmap ", ubound(moons, 1), "moons to ", trim(fname)
! write(0, *) "mapsize ", width, height ! write(0, *) "mapsize ", width, height
allocate (map(width, height), stat=errcode) allocate (cmap(width, height), stat=errcode)
! write(0, *) "errcode allocate ", errcode ! write(0, *) "errcode allocate ", errcode
map = -1 ! invalidate colmap ! map = -1 ! invalidate colmap
! DO SOME GOOD STUFF HERE ! DO SOME GOOD STUFF HERE
do ix=1, width do ix=1, width
@ -106,14 +107,16 @@ subroutine make_color_map(moons, fname, width, height)
endif endif
end do ! loop on all the moons, ipl index end do ! loop on all the moons, ipl index
map(ix, iy) = mod(near*13, 255) cmap(ix, iy)%r = mod(near*13, 255)
cmap(ix, iy)%g = mod(near*14, 255)
cmap(ix, iy)%b = mod(near*15, 255)
enddo enddo
enddo enddo
call spit_as_pgm_8(map, fname) call rgbpix_spit_as_pnm(cmap, fname)
deallocate(map) deallocate(cmap)
end subroutine end subroutine
!----------------------------------------------------------------------- !-----------------------------------------------------------------------

View File

@ -12,7 +12,7 @@ program essai
call init_random() call init_random()
call essai_near_planet(256, 1024) call essai_near_planet(1024, 1024)
STOP 'BECAUSE YOLO' STOP 'BECAUSE YOLO'
@ -64,9 +64,9 @@ subroutine essai_near_planet(nbplanets, szfield)
endif endif
end do ! loop on ipl end do ! loop on ipl
cmap(ix, iy)%r = mod(near*2, 255) cmap(ix, iy)%r = mod(near*4, 255)
cmap(ix, iy)%g = mod(near*3, 255) cmap(ix, iy)%g = mod(near*7, 255)
cmap(ix, iy)%b = mod(near*4, 255) cmap(ix, iy)%b = mod(near*11, 255)
enddo enddo

View File

@ -23,7 +23,7 @@ global_settings {
#declare HFNAME = concat(HFDIR, str(HFCK , -5, 0), ".pgm"); #declare HFNAME = concat(HFDIR, str(HFCK , -5, 0), ".pgm");
#declare CMDIR = "WS/colmap/"; #declare CMDIR = "WS/colmap/";
#declare CMNAME = concat(CMDIR, str(HFCK , -5, 0), ".pgm"); #declare CMNAME = concat(CMDIR, str(HFCK , -5, 0), ".pnm");
#debug concat("- - - - - - - ", HFNAME, " ", CMNAME, "\n") #debug concat("- - - - - - - ", HFNAME, " ", CMNAME, "\n")
@ -36,7 +36,7 @@ height_field {
} }
texture { texture {
pigment { pigment {
image_map { pgm CMNAME } image_map { ppm CMNAME }
// image_map { png "WS/mire1024.png" } // image_map { png "WS/mire1024.png" }
rotate x*90 rotate x*90
translate <-0.5, 0, -0.5> translate <-0.5, 0, -0.5>