1
! @(#)perspec.prg 19.1 (ES0-DMD) 02/25/03 13:20:16
2
! +++++++++++++++++++++++++++++++++++++++++++++++++
4
! MIDAS procedure perspec.prg to provide perspective view
5
! K. Banse 920103, 920109, 940318
8
! @a perspec inframe outframe rot_ang,tilt_ang plane_nos load_flag
10
! with rot_ang in [0,360] degrees and tilt_ang in [0,90] degrees:
11
! 0 degrees tilt means no tilt, i.e. normal view
12
! 90 degrees tilt shows side of plane, i.e. single line closest to viewer
13
! defaulted to 30.,60.
15
! plane_nos = plane1,plane2,...,planez, e.g. 1,2,5
16
! with each plane_no in [1,NPIX(3) of inframe]
17
! or ALL, if all planes should be shown; defaulted to ALL
19
! load_flag = Y(es) or N(o) for loading or not loading the resframe
22
! the result frame does not contain the plotted lines, to redraw those
23
! lines on top of the displayed result frame, use @a perspec,draw
25
! +++++++++++++++++++++++++++++++++++++++++++++++++
27
define/param p1 ? ima "Enter input frame: "
28
define/param p2 ? ima "Enter output frame: "
29
define/param p3 30.,60. n "Enter rot_angle,tilt_angle in degrees: "
30
define/param p4 all c "Enter plane no's.: "
31
define/param p5 y c "Enter load_flag: "
35
write/keyw inputr 'p3'
36
write/keyw inputc 'p4'
39
write/descr {out_a} history/c/1/80 -
40
"created via: @a perspec {p1} {p2} {p3} {p4} "
42
if p5(1:1) .eq. "Y" then
47
entry draw !the drawing is done here
52
draw/line {outputr(1)},{outputr(2)},{outputr(3)},{outputr(4)} f
53
draw/line {outputr(3)},{outputr(4)},{outputr(5)},{outputr(6)} f
54
draw/line {outputr(1)},{outputr(2)},{outputr(7)},{outputr(8)} f
55
draw/line {outputr(5)},{outputr(6)},{outputr(7)},{outputr(8)} f
57
define/local noplan/i/1/1 0
58
noplan = outputr(13) !get no. of planes
59
if noplan .lt. 2 return
61
draw/line {outputr(1)},{outputr(2)},{outputr(1)},{outputr(9)} f
62
draw/line {outputr(3)},{outputr(4)},{outputr(3)},{outputr(10)} f
63
draw/line {outputr(5)},{outputr(6)},{outputr(5)},{outputr(11)} f
64
define/local loop/i/1/2 0,0
67
define/local rr/r/1/5 0.,0.,0.,0.,0.
68
define/local kl/i/1/2 0,0
71
rr({kl}) = outputr({kl(2)})
73
rr(5) = rr(4) + outputr(15)
74
draw/line {outputr(7)},{rr(4)},{outputr(7)},{rr(5)} f
75
if loop(2) .le. 0 goto last_plane
79
rr({kl}) = rr({kl})+outputr(16)
81
draw/line {outputr(1)},{rr(1)},{outputr(3)},{rr(2)} f
82
draw/line {outputr(3)},{rr(2)},{outputr(5)},{rr(3)} f
83
draw/line {outputr(1)},{rr(1)},{outputr(7)},{rr(4)} f
84
draw/line {outputr(5)},{rr(3)},{outputr(7)},{rr(4)} f
85
rr(5) = rr(4) + outputr(15)
86
draw/line {outputr(7)},{rr(4)},{outputr(7)},{rr(5)} f
90
draw/line {outputr(1)},{outputr(9)},{outputr(3)},{outputr(10)} f
91
draw/line {outputr(3)},{outputr(10)},{outputr(5)},{outputr(11)} f
92
draw/line {outputr(1)},{outputr(9)},{outputr(7)},{outputr(12)} f
93
draw/line {outputr(5)},{outputr(11)},{outputr(7)},{outputr(12)} f