Exporting image sequences
Processing is a great tool to make videos. In older versions of Processing, there was the MovieMaker class, which allowed you to render the output of your sketch to a QuickTime movie. This class has been removed from Processing 2, as it uses the GStreamer framework now, instead of QuickTime. In this recipe, you'll learn how to export your work as an image sequence, so that you can create a video file afterwards.
How to do it...
This is the full code for the example. I've used an array of PVector
objects to draw lines and circles to the screen, animated using Brownian motion. When the running sketch reaches frame 900, the application will quit.
int randomNum; l PVector[] points; float radius = 2; void setup() { size( 1280, 720 ) smooth(); background( 234, 228, 17 ); points = new PVector[64]; for ( int i = 0; i < points.length; i++ ) { points[i] = new PVector(random(width), random(height)); } frameRate( 30 ); randomNum...