User Tools

Site Tools


This is an old revision of the document!

Processing Tutorial

Part 12: Video

-12.1: Frame-Based Animation

We can do frame-based animation, but we have to use the Book's classes. See the Bugs and Workarounds section of Reports for more.

If we are to use the book's classes, we have to have them as tabs in the current sketchbook or put them in the “code” folder. This can get messy, but it works. It's safe to include them all except

An example:

import java.awt.*;

//public class MovieMaker_java {  //As an application
public class MovieMaker_java extends PApplet{ //As a sketch

  //public void makeRectangleMovie  //As an application
  void makeRectangleMovie(String directory) //As a sketch
    int framesPerSecond = 30;
    Picture p;
    Graphics g = null;
    FrameSequencer frameSequencer = new FrameSequencer(directory);
    for(int i=0; i<framesPerSecond; i++)
      p = new Picture(640,480);
      g = p.getGraphics();
  //public static void main(String[] args)  //As an application
  void setup() //As a sketch
    MovieMaker_java movieMaker = new MovieMaker_java();
    String dir = "C:\\";

Next: Part 13- Abbreviated Reference Guide

Last: Part 11- Sound

part_12-_video.1181071661.txt.gz · Last modified: 2007/08/30 13:53 (external edit)