pro rotate_surf,data,colmap=colmap shades=5^byte(data) sortsh=shades(sort(shades)) colourfac=1 axv=50 azv=30 device,decomposed=0 xbox=[0.3,0.5] ybox=[0.88,0.95] xline1=mean(xbox) if keyword_set(colmap) then ctab=colmap else ctab=4 loadct,ctab,bottom=min(data) while 1 do begin shadscale=50*(1+data/max(data)) SHADE_SURF, data, AX = axv, az = azv,shades=byte(shadscale)*colourfac xyouts,0.1,0.93,strcompress("AZ: "+string(fix(axv))+" ZA:"+string(fix(azv))),/norm xyouts,0.9,0.93,"Left button to rotate",alignment=1,/norm xyouts,0.9,0.91,"Middle button to change colour scale",alignment=1,/norm xyouts,0.9,0.89,"Right Button to Quit",alignment=1,/norm cursor,x0,y0,/down,/norm cursor,x1,y1,/up,/norm if !mouse.button eq 1 then begin azrot=180*(x1-x0) axrot=180*(y0-y1) axv=(axv+axrot) mod 360 azv=(azv+azrot) mod 360 endif if !mouse.button eq 2 then begin colourfac=abs(colourfac*(y1/y0)) mod 500 endif if !mouse.button eq 4 then return endwhile end