quick! help setting up a video array?
in
Core Library Questions
•
5 months ago
hi,
i am a grad stdent and have crit in a week... ive been having trouble trying to get my video project running on processing and i'm new to processing, so im not sure what's wrong.
at first i think it was a memory issue, but i increased my memory allowance in preferences.
it seems to run (as in there's no issues with the code and it opens, but then nothing happens... no screen pops up with videos...) is it still just thinking/working?
what i want to do is: start off with a video playing (compound9.mov) then i want another movie to be randomly selected from an array each time the mouse is clicked, and for it to start playing at that location (of the mouse click). ultimately i want movies to layer and crowd each other out.
here's the code that i've got so far:
import processing.video.*;
int maxMovies= 42;
int myMoviesIndex=0;
Movie[] myMovies=new Movie[maxMovies] ;
Movie firstclipMovie;
void setup() {
size (1400, 800);
frameRate (45);
background(0);
firstclipMovie = new Movie(this, "compound9.mov");
firstclipMovie.play();
myMovies=new Movie[maxMovies];
for (int i = 0; i < myMovies.length; i ++ ) {
myMovies[i] = new Movie(this, i+1 + ".mov");
myMovies[i].read();
myMovies[i].play();
}
}
void movieEvent (Movie firstclipMovie) {
firstclipMovie.read ();
}
void mousePressed () {
image(myMovies[myMoviesIndex],0,0,mouseX,mouseY);
}
void draw() {
tint(255,155);
background(0);
image(firstclipMovie, 0,0, width, height);
if (mousePressed==true) {
image(myMovies[int(random(myMoviesIndex))],0,0,mouseX,mouseY);
}
}
any and all help would be greatly appreciated! also, i am not 100% sure in what i'm doing, so please let me know where to look stuff up, too.
thanks!
--judy
i am a grad stdent and have crit in a week... ive been having trouble trying to get my video project running on processing and i'm new to processing, so im not sure what's wrong.
at first i think it was a memory issue, but i increased my memory allowance in preferences.
it seems to run (as in there's no issues with the code and it opens, but then nothing happens... no screen pops up with videos...) is it still just thinking/working?
what i want to do is: start off with a video playing (compound9.mov) then i want another movie to be randomly selected from an array each time the mouse is clicked, and for it to start playing at that location (of the mouse click). ultimately i want movies to layer and crowd each other out.
here's the code that i've got so far:
import processing.video.*;
int maxMovies= 42;
int myMoviesIndex=0;
Movie[] myMovies=new Movie[maxMovies] ;
Movie firstclipMovie;
void setup() {
size (1400, 800);
frameRate (45);
background(0);
firstclipMovie = new Movie(this, "compound9.mov");
firstclipMovie.play();
myMovies=new Movie[maxMovies];
for (int i = 0; i < myMovies.length; i ++ ) {
myMovies[i] = new Movie(this, i+1 + ".mov");
myMovies[i].read();
myMovies[i].play();
}
}
void movieEvent (Movie firstclipMovie) {
firstclipMovie.read ();
}
void mousePressed () {
image(myMovies[myMoviesIndex],0,0,mouseX,mouseY);
}
void draw() {
tint(255,155);
background(0);
image(firstclipMovie, 0,0, width, height);
if (mousePressed==true) {
image(myMovies[int(random(myMoviesIndex))],0,0,mouseX,mouseY);
}
}
any and all help would be greatly appreciated! also, i am not 100% sure in what i'm doing, so please let me know where to look stuff up, too.
thanks!
--judy
1