I've compiled this sketch from parts of other sketches- when you move in front of the kinect a photo appears on you and moves around as you move. However I don't just want one photo but a random photo chosen from an array.
The problem is in the last line of this sketch- I'm calling a random photo from the array to show on top of the centre-of-mass tracking.
It works so to speak but I think as this is not a 'mousepressed' like single event - the Kinect is instead constantly updating to produce many events and so is constantly calling a random photo from the array for every person it tracks rather than sticking with one random chosen photo per person- so it just constantly shuffles between the three photos.
I'm aware I need to separate this last line and have a:
(choose one random photo) event and
a (assign this one previously chosen random photo to the centre of mass tracking) event - so that a new user entering the area will have one different photo appear on top of them.
but I can't work out how to split the one line into the two. Any help would be greatly appreciated.
here's the (working imperfectly) sketch:
import SimpleOpenNI.*;
SimpleOpenNI kinect;
import fullscreen.*;
FullScreen fs;
int maxImages = 3; //total number of images (examples)
PImage[] images = new PImage[maxImages];
void setup() {
size(640,480);
background(30);
fs = new FullScreen(this); // Create the fullscreen object
//the above line puts a photo onto the centre point- but it's running through all 3- I wanted it to pick one at random and stick with that- so how to split this line into two?