- 积分
- 0
- 注册时间
- 2007-9-18
- 仿真币
-
- 最后登录
- 1970-1-1
|
这是定义地下水位的程序,看不太懂,哪位能解释一下:
1.table1后面的一系列数据表示啥意思?
2. 能否用汉语说一下生成水面的过程?
def parm
nptab1=7
nprof=10
end
parm
table 1 12 0 18.25 12.5 25 17 35 21 50 24 75 25 150 25
def aux1
loop n(1,nptab1)
rr=xtable(1,n)
zz=ytable(1,n)
loop k(1,nprof)
case_of k
alfa=0.5*(pi+.1)*float(k-2)/float(nprof-2)
xtable(n+10,k)=rr*cos(alfa)
ytable(n+10,k)=rr*sin(alfa)
case 1
xtable(n+10,k)=rr
ytable(n+10,k)=-40.0
case 2
xtable(n+10,k)=rr
ytable(n+10,k)=0.0
end_case
end_loop
end_loop
end
aux1
def aux2
command
set grav 0 0 -10
water dens 1000
end_command
loop n(1,nptab1-1)
loop k (1,nprof-1)
xx1=xtable(n+10,k)
yy1=ytable(n+10,k)
zz1=ytable(1,n)
xx2=xtable(n+10,k+1)
yy2=ytable(n+10,k+1)
zz2=zz1
xx3=xtable(n+11,k+1)
yy3=ytable(n+11,k+1)
zz3=ytable(1,n+1)
xx4=xtable(n+11,k)
yy4=ytable(n+11,k)
zz4=zz3
command
WATER TABLE face xx1,yy1,zz1 xx2,yy2,zz2 xx3,yy3,zz3
WATER TABLE face xx1,yy1,zz1 xx3,yy3,zz3 xx4,yy4,zz4
end_command
end_loop
end_loop
end
aux2
ret |
|