[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xinteranimate problem!!



Scott Reid (mensar@leeds.ac.uk) writes:

> I would like to thank everyone in the group for the help they have given
> me so far, particularly Liam Gumley. My latest problem is with
> XINTERANIMATE. The program runs, but I seem to be getting an error which
> says that 'only one animation at a time is allowed'. In the window I get
> the error :
> 
> % Program caused arithmetic error: Floating divide by 0
> 
> I believe the xinteranimate is loading the sequence 22 times. The
> program is :-
> 
> pro OnOpen
> 
>   ; Get the Filename
>   openr, 1, 'E:/Temp/batch.rvd'
>   datas=fltarr(3,36,49,22)
>   readf, 1, datas
>   close, 1
>   h=rebin(reform(datas[2,*,*,*]), 72, 98, 22)
>   loadct, 3
> ; erase
>   frames = fltarr(512, 512, 22)
>   window, 1, TITLE='Bloodflow animation', xsize=512, ysize=512
>   XINTERANIMATE, set=[512,512,22]
>   for i=0, 21 do begin shade_surf, h[*,*,i], zrange=[-1,+1] &
> frames[*,*,i]=tvrd() & xinteranimate & end
> 
> end

Well, your XINTERANIMATE loop is just a bit wrong. I'd
do it like this:

   ; Get the Filename
   openr, 1, 'E:/Temp/batch.rvd'
   datas=fltarr(3,36,49,22)
   readf, 1, datas
   close, 1
   h=rebin(reform(datas[2,*,*,*]), 72, 98, 22)
   loadct, 3
   XINTERANIMAGE, Set=[512, 512, 22], /Showload
   FOR j=0,21 DO BEGIN
	Shade_Surf, h[*,*,j], ZRange=[-1, 1]
       XINTERANIMATE, Frame=j, Window=!D.Window
   ENDFOR
   XINTERANIMATE
   END

> One other small thing that I have also experienced is that the loadct
> command does not seem to load any colour map to my shaded surface. It
> simply appears black and white.

I'd add a DEVICE, DECOMPOSED=0 to the top of the file. :-)

Cheers,

David

-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155