What is this?
MetaSurface is a library for processing that allows you to easily control multiple parameters and whole sets of those. Additionally you can fade smoothly from one set to another, record changes of settings over time, play those back again and export your sketch to video. If that description wasn't helpful at all you might just want to try the demo below.Getting Started
First download the latest version and extract it to sketch-folder/libraries/. (Re-)start Processing. If everything went okay you should now have a few examples inFile » Sketchbook » Libraries » Examples » MetaSurface.
Command Reference
If you pass null an open-dialog will be shown to the user.
If you pass null the currently opened file's name will be used for saving.
Thanks, attribution and such...
As one might have figured this project isn't all that unique. Even more so, it was created when I needed something like Audiomulch's metasurface, but to control a processing sketch instead of an audio patch (har har).So a big thanks also goes to Francesco Meneghini, who led the original project that resulted in this code, for letting me open source the it.
Example Usage
import metasurface.*; // If you don't want to use the "export sketch to movie" functionality // built into the metasurface disable the following line: import processing.video.*; float t; float rotX, rotY; float rotXSpeed, rotYSpeed; float amplitude; MetaSurface surface; void setup(){ size( 200, 200, P3D ); // Create the meta surface object surface = new MetaSurface( this, new String[]{ "Rotation speed X", "Rotation speed y", "Amplitude" }, // Labels new float[]{ -.1, -.1, 0 }, // Minimum Values new float[]{ .1, .1, 90 }, // Maximum Values new float[]{ 0, 0, 90 } // Default Values ); } void draw(){ rotXSpeed = surface.values[0]; // Access first value rotYSpeed = surface.values[1]; // Access second value amplitude = surface.values[2]; // Access third value // now do some drawing with those parameters background( 255 ); lights(); noStroke(); fill( 150 ); t += 0.1; rotX += rotXSpeed; rotY += rotYSpeed; translate( width/2, height/2 ); rotateX( rotX ); rotateY( rotY ); for( int x = -50; x < 50; x += 5 ){ for( int y = -50; y < 50; y += 5 ){ pushMatrix(); translate( x, y ); box( 5, 5, f( x, y ) ); popMatrix(); } } } float f( float x, float y ){ return amplitude * sin( x + t ) * cos( x*x ) * cos( y/4 + t ); }