PRO s_spin,xp,yp ;xp=200 ;yp=200 frames = 30 const=256 xwin = const ywin = const ximg = const yimg = const densspin = Bytarr(ximg, yimg, frames) Openr, 1, "spin.byt" readu,1,densspin Window, 3, Xsize=xwin, Ysize=ywin, Xpos=xp, Ypos=yp, $ Title='3D Volume Rotation.', Retain=1,colors=256 Device, /Cursor_Original Tvcrs, 1 Loadct, 8 Tv, densspin(*, *, 0) Empty Flush, 1 Close, 1 frame_delay = 0.0 slide_delay = 0.0 ani_cycles = 50 xf=0 yf=0 outx=0 outy=0 FOR loop=1, ani_cycles DO BEGIN FOR i=0, (frames-1) DO BEGIN Tv, densspin(*, *, i) Empty Wait, frame_delay cursor,xd,yd,0,/device while(!err eq 2)do begin la: cursor,xd,yd,0,/device if(!err eq 4)then goto, lb if(!err eq 1)then goto, lc if(!err eq 0)then goto, la endwhile lb: !err=0 ENDFOR ENDFOR Wait, slide_delay lc: return END