发一个例子给你,自己去研究
new
Define getCodeDim
codeDim = DIM
end
getCodeDim
;
Define iniArrays
Array aPoly1(codeDim,3) aPoly2(codeDim,3) v1(codeDim) v2(codeDim)
End
;
Define poly1
aPoly1(1,1) = -2.0
aPoly1(2,1) = 0.0
aPoly1(3,1) = -2.0
aPoly1(1,2) = 0.0
aPoly1(2,2) = 0.0
aPoly1(3,2) = 2.0
aPoly1(1,3) = 2.0
aPoly1(2,3) = 0.0
aPoly1(2,3) = -2.0
status = set_line_width(4)
status = draw_poly(aPoly1, 3, 1)
End
Define poly2
aPoly2( 1,1) = -1.0
aPoly2(codeDim,1) = -1.0
aPoly2( 1,2) = 0.0
aPoly2(codeDim,2) = 1.0
aPoly2( 1,3) = 1.0
aPoly2(codeDim,3) = -1.0
if codeDim = 3 then
aPoly2(2,1) = 0.0
aPoly2(2,2) = 0.0
aPoly2(2,3) = 0.0
Endif
Status = set_line_width(0)
Status = fill_poly(aPoly2, 3)
End
Define line1
v1( 1) = -3
v1(codeDim) = -3
v2( 1) = 3
v2(codeDim) = -3
if codeDim = 3 then
V1(2) = 0
V2(2) = 0
Endif
Status = set_line_width(2)
Status = draw_line(v1, v2)
End
Define text1
sMsg = '消灭日本'
Status = draw_string(v1, sMsg)
End
;
plot creat twobrick
plot add fish poly1 magenta
plot add fish poly2 white
plot add fish line1 black
plot add fish text1 yellow
plot set m m
plot set mag 0.5
plo set distance 10 center 0 0 0
plot add axes blue
plot show