m_vol_surf.pro
pro m_vol_surf,val
; try val of 120
xwind=600
ywind=600
openr,1,'fan.128_ascii'
openw,2,'vol_surf.byt'
u=intarr(128,128,62)
readf,1,u
q=assoc(2,bytarr(xwind,ywind))
vol=intarr(64,64,62)
svol=size(vol)
dn=float(max([svol(1), svol(2), svol(3)])-1)
!x.range=[0.0, (svol(1) - 1)]
!y.range=[0.0, (svol(2) - 1)]
!z.range=[0.0, (svol(3) - 1)]
vol=rebin(u,128/2,128/2,62)
window,2,xsize=xwind,ysize=ywind,xpos=250,ypos=130
loadct,1
Center_View,xr=[0.0, 64.0],yr=[0.0, 64.0],zr=[0.0, 62.0]$
,ax=(-60.0), az=45.0,zoom=0.9,winx=xwind,winy=ywind
t3d,tr=[-.5,-.5,-.5]
scale3d
shade_volume,vol,val,v,p
set_shading,gouraud=1,light=[0,0,-1],reject=0
img=polyshade(v,p,/T3d)
tvscl,img
!x.window=[0.0, float(svol(1) - 1) / dn] + !x.s(0)
!y.window=[0.0, float(svol(2) - 1) / dn] + !y.s(0)
!z.window=[0.0, float(svol(3) - 1) / dn] + !z.s(0)
axis,0,0,0,/xaxis,/T3d
axis,0,0,0,/yaxis,/T3d
axis,0,0,0,/zaxis,/T3d
q(0)=tvrd(0,0,xwind,ywind)
close,1
close,2
end