!     MAKE A VRML MOVIE FILE
!     MSE 6270, Leonid Zhigilei
!     This is not done yet.  The idea is to prepare movies
!     that can be viewed by a VRML browser.
      Subroutine Movie()
      Include 'common.h'
!
      If(mov.EQ.2) then
!       Initialize movie file and open the Header file
        Open(795,FILE = './movie.rc',STATUS='old')
        Read(795,*) stmov, scale
        Do I=1,100
          rcolor(i) = 0.0
          gcolor(i) = 0.0
          bcolor(i) = 0.0
          radius(i) = 1.4+scale
        EndDo
        reading: Do
          Read(795,*,END=1225) izz,rad,red,gre,blu
          radius(izz) = rad+scale
          rcolor(izz) = red
          gcolor(izz) = gre
          bcolor(izz) = blu
        End do reading
 1225   Continue
        Close(795)
        nframes=nstep*DELTA/stmov+1
        Write(19,8015) nan, nframes
!       Print the frame
        Do i = 1, nan
          k = khist(i)
          xis = xd(1,i)
          yis = xd(2,i)
          zis = xd(3,i)
          ris = radius(i)
          rcs = rcolor(k)
          gcs = gcolor(k)
          bcs = bcolor(k)
          Write(19,8025) xis,zis,yis,ris,rcs,gcs,bcs
        EndDo
        mov=3
      ElseIf( mov .EQ. 3 ) then
!       Print the frame
        Do i = 1, nan
          k = khist(i)
          xis = xd(1,i)
          yis = xd(2,i)
          zis = xd(3,i)
          ris= radius(i)
          rcs = rcolor(k)
          gcs = gcolor(k)
          bcs = bcolor(k)
          Write(19,8025) xis,zis,yis,ris,rcs,gcs,bcs
        EndDo
      EndIf
 8015 Format( 3(f9.3,1x),/,3(f7.2,1x),/,i5,/,i5 )
 8025 Format( 3(f9.3,1x),4(f5.2,1x) )
      Return
      End









