|
|||
Description Downloads BGS Methods Screenshots Processing |
Scene with Processing 2 and Processing 3 The Scene Processing Library 3.0 is an extension of the TUIO 1.1 Processing Library that also handles TUIO blobs, and includes a SceneBlob class that simplifies object tracking and analysis. 2.- Download Scene_Processing-3.0.zip. 3.- Extract the folder called Scene to the "libraries" folder of your Processing sketchbook . Documentation HTML files generated with Javadoc may be viewed online here. The library zip includes the javadoc files in the "reference" folder. Examples The program SceneDemo.pde shows the basic usage of the library. Both TUIO and Scene libraries must be imported at the beginning of the sketch. The constructor creates a Scene client that listens on the default port 3333. After reading the TUIO messages, the individual Scene blobs are extracted inside a loop and most of their information is printed. For a complete list of methods and properties see the documentation.The sketch also shows the optional callback methods that are called whenever a blob is added, removed or updated. import TUIO.*; import scene.tuio.*; Scene sceneClient; void setup() { sceneClient = new Scene(this); } void draw() { ArrayList<SceneBlob> sceneBlobList = sceneClient.getSceneBlobList(); for (int i=0;i<sceneBlobList.size();i++) { SceneBlob sblb = sceneBlobList.get(i); println("Blob: " + sblb.getBlobID() + " " + sblb.getSessionID() + " " + sblb.getCenterOfMassX() + " " + sblb.getCenterOfMassY() + " " + sblb.getCenterOfMassScreenX(width) + " " + sblb.getCenterOfMassScreenY(height) + " " + sblb.getCenterOfMassXSpeed() + " " + sblb.getCenterOfMassYSpeed() + " " + sblb.getCenterOfMassMotionAccel() + " " + sblb.getBlobX() + " " + sblb.getBlobY() + " " + sblb.getBlobScreenX(width) + " " + sblb.getBlobScreenY(height) + " " + sblb.getBlobAngle() + " " + sblb.getBlobWidth() + " " + sblb.getBlobHeight() + " " + sblb.getBlobScreenWidth(width) + " " + sblb.getBlobScreenHeight(height) + " " + sblb.getBlobArea() + " " + sblb.getBlobXSpeed() + " " + sblb.getBlobYSpeed() + " " + sblb.getBlobRotationSpeed() + " " + sblb.getBlobMotionAccel() + " " + sblb.getBlobRotationAccel() + " " + sblb.getBlobAspectRatio() + " " + sblb.getBlobContractionIndex() + " " + sblb.getBlobEquivDiameter() ); } } void addSceneBlob(SceneBlob sblb) { println("SceneBlob added"); } void removeSceneBlob(SceneBlob sblb) { println("SceneBlob removed"); } void updateSceneBlob(SceneBlob sblb) { println("SceneBlob updated"); } The library also includes the following examples: SceneTuioBlobDemo.pde - A TUIO Cursor and TUIO Blob client example
|