AugmentaP5 API

67 %
33 %
Information about AugmentaP5 API

Published on March 9, 2016

Author: DavidAlexandreCHANEL

Source: slideshare.net

1. Tom Duchêne :: David-Alexandre Chanel AugmentaP5 API https://github.com/Theoriz/AugmentaP5

2. Setup the library • Include the library in your project import augmentaP5.*; • Declare the augmenta receiver AugmentaP5 auReceiver; • Initialize the augmenta receiver auReceiver = new AugmentaP5(this, oscPort);

3. Three paradigms 1) Get an array of all the people in the scene 2) Listen to enter/update/willleave messages 3) Get the oldest/newest person in the scene

4. 1 – People array • Get the people array every frame AugmentaPerson[] people = auReceiver.getPeopleArray(); • Use data from the array println(“x=“+ people[i].centroid.x);

5. 2 – Messages • Person entered void personEntered (AugmentaPerson p) { println(" Person entered : "+ p.id ); }; • Person updated void personUpdated (AugmentaPerson p) { println(" Person updated : "+ p.id ); }; • Person willLeave void personWillLeave (AugmentaPerson p) { println(" Person left : "+ p.id ); };

6. 3 – Oldest/Newest person • You can get the oldest/newest person in the scene if you only need one interacting person AugmentaPerson p = auReceiver.getOldestPerson(); println(“The oldest person is n°“+p.pid);

7. Tools

8. Scene size • A scene size in pixels is sent by the data merging software, you can use it as your processing scene size to make sure your data will be correctly calibrated int[] sceneSize = auReceiver.getSceneSize();

9. TimeOut • When a point has not been updated for a certain time it will be removed by the API • You can set this time by calling the setTimeOut() function auReceiver.setTimeOut(n); • One parameter - “n” : number of frames before a stale point is deleted (int, default is 120 frames)

10. Interactive area • You can restrict the interactive area to a portion of the scene auReceiver.interactiveArea.set(x, y, width, height); • Four parameters - “x” : x position of the top left corner (float, between 0 and 1) - “y” : y position of the top left corner (float, between 0 and 1) - “width” : width of the area (float, between 0 and 1) - “height” : height of the area (float, between 0 and 1) • UI available in the Augmenta2D example

11. TUIO • You can also receive TUIO data instead of Augmenta, the TUIO information are then transformed into AugmentaPerson so you have nothing to change in your code. // Augmenta auReceiver= new AugmentaP5(this, port); // TUIO auReceiver= new AugmentaP5(this, port, true);

12. Debug information • You can draw debug information for the objects of the scene • For the persons present in the scene (displays the centroid, the bounding box, the pid, etc.) p.draw(); • For the interactive area (displays the rectangle) interactiveArea.draw();

13. Examples

14. Examples • Augmenta Basic - Draw Augmenta data without any other library needed • Augmenta 2D - Adding a GUI and syphon/spout output • Augmenta 3D - 3d examples with a camera and a GUI • Augmenta drawZone - Draw persistent white circles under people’s feet • Augmenta Assets - Add a lot of assets you could use in your project - Sprites / Video / Sound / Audioreaction - Triggers classes (circles, rectangles, complex polygons)

Add a comment

Related pages

GitHub - Theoriz/AugmentaP5: Processing library and examples

Theoriz / AugmentaP5. Code. Issues 0. ... http://fr.slideshare.net/theoriz/augmentap5-api. Contribute. Check TODO and TOFIX, then get Eclipse to modify ...
Read more

github.com

@@ -1,35 +1,35 @@ # More on this file here: https://github.com/processing/processing/wiki/Library-Basics # UTF-8 supported.-# The name of your library as ...
Read more