Hi guys, I really need your help and is what you would consider a newbie at processing so bare with me.
I am creating a slideshow with 15 different images (5 images split in half and 5 background images) that should be projected onto two sliding doors. The idea is that when the first door opens, the initial picture will split in half and slide out with the doors, and after this, the next image should be projected onto the door behind that is not opened yet. The images will be controlled by an open and a close switch.
The problem with the code right now is that the images are selected randomly, and that the background is just black. This is where I would like another image to be projected.
The images should load in this way:
moonwalk1a.jpg +moonwalk1b.jp
- and when these slide away a new image, lets call it moonwalkbackground1.jpg should be projected.
When the doors then are triggered again by the "closed door switch" moonwalk2a +moonwalk2b should slide in and be projected and then moonwalkbackground2 etc.
I really hope someone can help and understand my question!
Here is my code as it looks now:
/* REMOVE THIS LINE TO ENABLE ARDUINO
import processing.serial.*;
import cc.arduino.*;
// For demo the arduino-parts are commented out.
REMOVE THIS LINE TO ENABLE ARDUINO */
/**
* The code is loosely based on the 'Load and Display'-example from Processing.
* It lends from the Arduino-Firmata sketch and the Firmata standard must be
* loaded on the Arduino.
*/
// Arduino arduino;
PImage[] img;
boolean doorContactOpening = false; // variables for the door sensors.
boolean doorContactClosing = false;
int openDoor = 0; // variable for the degree of which the door is open
int doorSpeed = 3; // Setting the speed of the doors
long lastUpdate;
int currentImage = 1;
void setup() {
size(640, 360);
/* REMOVE THIS LINE TO ENABLE ARDUINO
arduino = new Arduino(this, Arduino.list()[0], 57600);
arduino.pinMode(2, Arduino.INPUT);
arduino.pinMode(3, Arduino.INPUT);
REMOVE THIS LINE TO ENABLE ARDUINO */
// The image files must be in the data folder of the current sketch
// to load successfully
img = new PImage[10];
img[0] = loadImage("moonwalk1a.jpg"); // Load the images into the program