Compare commits
4 Commits
086c2af118
...
a20725f5ef
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a20725f5ef | ||
|
|
42d066678d | ||
|
|
ea373fa198 | ||
|
|
52e5e99b07 |
6
Makefile
6
Makefile
@@ -17,7 +17,7 @@ rndwlkng: rndwlkng.f90 Makefile genplotting.o
|
||||
|
||||
rndwlkng.png: rndwlkng Makefile
|
||||
./rndwlkng
|
||||
convert rndwlkng.png rndwlkng.png
|
||||
convert rndwlkng.tga rndwlkng.png
|
||||
|
||||
# -----------------------------------------------
|
||||
|
||||
@@ -35,8 +35,7 @@ starfield: starfield.f90 Makefile genplotting.o
|
||||
|
||||
starfield.png: starfield Makefile
|
||||
./starfield
|
||||
genplot2 -s 512x512 WS/starfield.scratch WS/a.tga
|
||||
convert WS/a.tga $@
|
||||
convert -verbose WS/a.tga $@
|
||||
|
||||
# -----------------------------------------------
|
||||
|
||||
@@ -65,7 +64,6 @@ spirale: spirale.f90 Makefile genplotting.o
|
||||
|
||||
spirale.png: spirale Makefile
|
||||
./spirale
|
||||
genplot2 -s 512x512 WS/spirale.scratch WS/a.tga
|
||||
convert WS/a.tga $@
|
||||
|
||||
# -----------------------------------------------
|
||||
|
||||
@@ -11,7 +11,7 @@ program morecircles
|
||||
integer idx
|
||||
real fdx, xp, yp, scx, scy
|
||||
call genp_init(0, "WS/morecircles.scratch")
|
||||
scx = 0.8 ; scy = 1.5
|
||||
scx = 0.6 ; scy = 2.3
|
||||
do idx=5, 60
|
||||
fdx = real(idx)
|
||||
xp = 3.5 * cos((fdx/14.0)-0.7)
|
||||
@@ -19,8 +19,8 @@ program morecircles
|
||||
call genp_set_offset(xp, yp)
|
||||
call genp_set_scale(scx, scy)
|
||||
call genp_circle(fdx, 60, 1+mod(idx, 3))
|
||||
scx = scx + 0.0075
|
||||
scy = scy - 0.0075
|
||||
scx = scx + 0.0185
|
||||
scy = scy - 0.0129
|
||||
enddo
|
||||
call genp_end(0)
|
||||
call genp_do_render("WS/morecircles.scratch", "morecircles.tga", &
|
||||
|
||||
24
rndwlkng.f90
24
rndwlkng.f90
@@ -11,27 +11,24 @@ program rndwlkng
|
||||
implicit none
|
||||
|
||||
type walker
|
||||
real :: xloc, yloc
|
||||
real :: xloc, yloc ! where I am ?
|
||||
real :: heading ! direction in degrees
|
||||
real :: powa
|
||||
real :: powa ! correlated to nothing
|
||||
end type walker
|
||||
|
||||
type (walker) drunky
|
||||
integer pass
|
||||
|
||||
drunky%xloc = 0.00
|
||||
drunky%yloc = 0.00
|
||||
drunky%heading = 13.37
|
||||
drunky%powa = 4.00
|
||||
call srand(time())
|
||||
|
||||
call genp_init(0, "WS/rndwlkng.scratch")
|
||||
|
||||
do pass=1, 100
|
||||
do pass=1, 73
|
||||
drunky%xloc = 5555 * (rand(0) - 0.50)
|
||||
drunky%yloc = 5555 * (rand(0) - 0.50)
|
||||
drunky%heading = 13.37
|
||||
drunky%powa = 4.00
|
||||
call move_the_walker(drunky, 1000, mod(pass, 5)+1)
|
||||
drunky%heading = 360 * rand(0)
|
||||
drunky%powa = 6.00
|
||||
call move_the_walker(drunky, 700, mod(pass, 6)+1)
|
||||
end do
|
||||
|
||||
call genp_end(0)
|
||||
@@ -47,18 +44,15 @@ subroutine move_the_walker(bob, nbmove, col)
|
||||
real :: rad, mv, dx, dy
|
||||
|
||||
call genp_move(bob%xloc, bob%yloc)
|
||||
|
||||
do idx=1, nbmove
|
||||
rad = ( 3.141592654 * bob%heading ) / 180.0
|
||||
mv = 0.5 + (bob%powa * rand(0))
|
||||
mv = 1.555 + (bob%powa * rand(0))
|
||||
dx = mv * sin(rad)
|
||||
dy = mv * cos(rad)
|
||||
bob%xloc = bob%xloc + dx
|
||||
bob%yloc = bob%yloc + dy
|
||||
bob%heading = bob%heading + 33 * (rand(0) - 0.50000)
|
||||
|
||||
bob%heading = bob%heading + 42.42 * (rand(0) - 0.50000)
|
||||
call genp_draw(bob%xloc, bob%yloc, col)
|
||||
|
||||
enddo
|
||||
|
||||
end subroutine
|
||||
|
||||
@@ -9,12 +9,15 @@ program spirale
|
||||
use genplotting
|
||||
implicit none
|
||||
|
||||
character(*), parameter :: scratch = "WS/spirale.scratch"
|
||||
|
||||
write (0, '(A)') "----[ genplotting spirale ]----"
|
||||
|
||||
call genp_init (0, 'WS/spirale.scratch')
|
||||
call do_spirale (1337, 0.51, 0.0666, 0.7, 3)
|
||||
call genp_init (0, scratch)
|
||||
call do_spirale (1337, 0.51, 0.0666, 0.7, 5)
|
||||
call do_spirale (1337, 0.42, 0.0333, 0.7, 6)
|
||||
call genp_end (0)
|
||||
call genp_do_render(scratch, "WS/a.tga", 512, 512)
|
||||
|
||||
contains
|
||||
! ---------------------------------------------------------
|
||||
|
||||
@@ -7,10 +7,15 @@
|
||||
program starfield
|
||||
use genplotting
|
||||
implicit none
|
||||
|
||||
character(*), parameter :: scratch = "WS/starfield.scratch"
|
||||
|
||||
write (0, '(A)') "----[ genplotting starfield ]----"
|
||||
call genp_init (0, 'WS/starfield.scratch')
|
||||
call do_starfield (200)
|
||||
call genp_init (0, scratch)
|
||||
call do_starfield (300)
|
||||
call genp_end (0)
|
||||
call genp_do_render(scratch, "WS/a.tga", 512, 512)
|
||||
|
||||
contains
|
||||
! ---------------------------------------------------------
|
||||
subroutine plot_a_star(at_x, at_y, sz, color)
|
||||
@@ -20,7 +25,7 @@ subroutine plot_a_star(at_x, at_y, sz, color)
|
||||
integer :: idx
|
||||
real :: rad, xv, yv
|
||||
|
||||
write(0, '("plot a star ", 2F8.3)') at_x, at_y
|
||||
write(0, '("plot a star at ", 2F8.3)') at_x, at_y
|
||||
call genp_set_offset(at_x, at_y)
|
||||
do idx=0, 360, 36
|
||||
! convert index to radians
|
||||
|
||||
Reference in New Issue
Block a user