Notes about Pure Data

Pure Data is a data-flow programming language.

It has three types of operations:

  • Inputs (sources of data)
  • Filters ( change the way the data flows)
  • Outputs (where the data goes)

Some things you should know

Route: route messages according to the first element

Unpack: split a message into atoms

TUIOClient: Outputs a list of TUIO messages, these messages need to be unpack

Flipbook script for Unity

//an array to hold frames
var flipbookFrames : Object [];

// currentFrame keeps track of what frame you are on
var currentFrame=0;

// FPS
var flipbookRate=24.0;

// use this for frame timer
var frameStartTime;

//built-in function
function Start ()
{
// load everything in the folder Assets/Resources/flipbook into Texture2D objects
flipbookFrames = Resources.LoadAll(“flipbook”,Texture2D);
//built-in property sets the texture for material
renderer.material.mainTexture=flipbookFrames[currentFrame];
frameStartTime=Time.time;

}
function Update () {

// check if enough time has passed to flip to next frame
if (Time.time >= frameStartTime + (1/flipbookRate))
{
// loop the image array
currentFrame++;
if (currentFrame>=flipbookFrames.length)
{
currentFrame=0;
}

// set the texture
renderer.material.mainTexture=flipbookFrames[currentFrame];

// reset frame timer
frameStartTime=Time.time;
}
}