User Tools

Site Tools


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.

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. See the Bugs and Workarounds section of Reports for more. 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.txt · Last modified: 2007/08/30 18:53 (external edit)