Making Movies from Simulations

Here is a method for creating an MPEG or AVI movie, or animated GIF, from your simulation animation.
  1. Include movie_camera.sim in your simulation. (Right-click to download on some browsers.) Make one instance of this model on your top level diagram. The box can be made vanishingly small.

  2. Run the simulation. The movie_camera.sim model snaps a picture of the SimView canvas at the period set within the DELAY in the while-loop. You may wish to modify the snap period, and/or place a DELAY call ahead of the while-loop to reach steady-state before capturing frames.

    The result of this step is a set of files called frame_00000.ppm to frame_00xxx.ppm, numbered sequentially.

  3. Run ppmtompeg or any other movie making utility. Here we explain how to use ppmtompeg.

  4. Play your movie:
                mplayer movie.mpeg


    Advanced Method

    The above method captures just the canvas of the SimView window. If you wish to capture the outer control panel as well, you may try the following method.

    1. Include movie_camera2.sim in your simulation. (Right-click to download on some browsers.) Make one instance of this model on your top level diagram, and place the following image on it. (Again, right-click to save the image below. (save-image-as))
      .

    2. Place a dummy box with the following image on it. (Again, right-click to save the image below.)
      .

    3. Follow remaining instructions above.