Compare commits
5 Commits
0bc55225fc
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bdeef4344e | ||
|
|
a27ee8fbdc | ||
|
|
e80bdd0ad5 | ||
|
|
1fc04c90ec | ||
|
|
fa334cd7de |
@@ -22,6 +22,7 @@ subroutine genp_test_rotation()
|
||||
call genp_set_rotation (real(pass)*0.10)
|
||||
write(0, *) " * the matrix was : "
|
||||
call genp_get_rot_matrix(mat)
|
||||
! display the rotation matrix
|
||||
do i=1, 3
|
||||
do j=1, 3
|
||||
write (0, '(" ", F8.5)', advance='no') mat(i,j)
|
||||
@@ -29,13 +30,9 @@ subroutine genp_test_rotation()
|
||||
write(0, *)
|
||||
end do
|
||||
|
||||
call genp_move(0.0, 0.0)
|
||||
pta(1) = 11.0 ; pta(2) = 0.0 ; pta(3) = 0.0
|
||||
ptb = matmul(mat, pta)
|
||||
write(0, '(" got XY: ", F8.5, " ", F8.5)') ptb(1), ptb(2)
|
||||
call genp_draw(ptb(1), ptb(2), 1+mod(pass, 7))
|
||||
end do ! pass
|
||||
|
||||
end subroutine
|
||||
! ---------------------------------------------------------
|
||||
! ---------------------------------------------------------
|
||||
end module
|
||||
|
||||
@@ -122,6 +122,11 @@ end subroutine
|
||||
subroutine genp_move (px, py)
|
||||
real, intent(in) :: px, py
|
||||
real :: lx, ly
|
||||
real :: pt(3)
|
||||
|
||||
! ====== insert rotation here ?
|
||||
pt(1) = px ; pt(2) = py ; pt(3) = 0.0
|
||||
|
||||
lx = (px*xscale) + xoffset
|
||||
ly = (py*yscale) + yoffset
|
||||
write (outunit, '(2F12.5, I5)') lx, ly, -1
|
||||
@@ -135,6 +140,9 @@ subroutine genp_draw (px, py, color)
|
||||
real, intent(in) :: px, py
|
||||
integer, intent(in) :: color
|
||||
real :: lx, ly
|
||||
|
||||
! ====== insert rotation here ?
|
||||
|
||||
lx = (px*xscale) + xoffset
|
||||
ly = (py*yscale) + yoffset
|
||||
write (outunit, '(2F12.5, I5)') lx, ly, color
|
||||
@@ -187,6 +195,18 @@ subroutine genp_circle(radius, steps, color)
|
||||
|
||||
end subroutine
|
||||
! ---------------------------------------------------------
|
||||
! draw a square centered on 0,0
|
||||
subroutine genp_square (amp, color)
|
||||
real, intent(in) :: amp
|
||||
integer, intent(in) :: color
|
||||
real :: ha
|
||||
ha = amp / 2.0
|
||||
call genp_move(-ha, -ha)
|
||||
call genp_draw(-ha, ha, color)
|
||||
call genp_draw( ha, ha, color)
|
||||
call genp_draw( ha, -ha, color)
|
||||
end subroutine
|
||||
! ---------------------------------------------------------
|
||||
subroutine genp_end (foo)
|
||||
integer, intent(in) :: foo
|
||||
|
||||
@@ -194,6 +214,7 @@ subroutine genp_end (foo)
|
||||
write (0, '("minmax X ", 2F18.5)') xmin, xmax
|
||||
write (0, '("minmax Y ", 2F18.5)') ymin, ymax
|
||||
|
||||
! XXX NASTY BUG HERE !
|
||||
write (outunit, '(2F18.5, I6)') xmin*1.05, ymin*1.05, -1
|
||||
write (outunit, '(2F18.5, I6)') xmin*1.05, ymax*1.05, 0
|
||||
write (outunit, '(2F18.5, I6)') xmax*1.05, ymax*1.05, 0
|
||||
|
||||
@@ -8,13 +8,14 @@ program starfield
|
||||
use genplotting
|
||||
implicit none
|
||||
|
||||
character(*), parameter :: scratch = "WS/starfield.scratch"
|
||||
character(*), parameter :: projname = "starfield"
|
||||
character(*), parameter :: scratch = "WS/"//projname//".scratch"
|
||||
|
||||
write (0, '(A)') "----[ genplotting starfield ]----"
|
||||
call genp_init (0, scratch)
|
||||
call do_starfield (300)
|
||||
call genp_end (0)
|
||||
call genp_do_render(scratch, "WS/a.tga", 512, 512)
|
||||
call genp_do_render(scratch, "WS/"//projname//".tga", 512, 512)
|
||||
|
||||
contains
|
||||
! ---------------------------------------------------------
|
||||
@@ -25,7 +26,7 @@ subroutine plot_a_star(at_x, at_y, sz, color)
|
||||
integer :: idx
|
||||
real :: rad, xv, yv
|
||||
|
||||
write(0, '("plot a star at ", 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
|
||||
|
||||
@@ -12,7 +12,6 @@ program testbed
|
||||
|
||||
call genp_init(0, "foo.scratch")
|
||||
call genp_test_rotation()
|
||||
! call genp_plot_axes(5.1)
|
||||
call genp_end(0)
|
||||
|
||||
end program
|
||||
|
||||
Reference in New Issue
Block a user