pro kgbox,rlo,rhi,ax,az,nosurf=nosurf
;
; make t3d transformation for a box with upper and lower boundary defined
; by rlo and rhi, turned the angles ax, az.
;
; done by Klaus Galsgaard
;
; name changes from box to kgbox (Bo, May 20, 1994)
on_error,2
if n_params() eq (0) then begin
print
print,'Procedure kgbox (was: box)'
print
print,'kgbox,rlo,rhi,ax,az,nosurf=nosurf'
print,'rlo,rhi : lower and upper boundary of box'
print,'ax,az : turning angles around x and z axis'
print,'nosurf : make a box with out changing t3d,'
print,' : 1 - without tick marks, ne (0,1) make new t3d setup.'
print,' : 2 - make a setup with out real t3d + box and tick marks'
return
end
if n_elements(ax) eq 0 then ax=30
if n_elements(az) eq 0 then az=30
x0=rlo(0) & x1=rhi(0)
y0=rlo(1) & y1=rhi(1)
z0=rlo(2) & z1=rhi(2)
z=fltarr(2,2)
z(0,*)=z0 & z(1,*)=z1
if keyword_set(nosurf) eq 0 then begin
erase
t3dset,rlo,rhi,ax=ax,az=az,scale=.57,per=5
surface,z,[x0,x1],[y0,y1],/nodata,/t3d
endif else begin
if nosurf eq 1 then begin
plots,[x1,x0,x0,x0],[y0,y0,y1,y1],[z0,z0,z0,z1],/t3d,/data
endif else if nosurf eq 2 then begin
surface,z,[x0,x1],[y0,y1],ax=ax,az=az,/nodata,/save
endif else begin
t3dset,rlo,rhi,ax=ax,az=az,scale=.57,per=5
return
endelse
end
plots,[x0,x1,x1],[y1,y1,y0],[z0,z0,z0],/t3d,/data
plots,[x0,x1,x1],[y1,y1,y0],[z1,z1,z1],/t3d,/data
plots,[x1,x1],[y1,y1],[z0,z1],/t3d,/data
plots,[x1,x1],[y0,y0],[z0,z1],/t3d,/data
end