I can't comment on the contributed libraries part, if they play any part (but congrats for posting in the right forum!

) but I see a couple of places where you can do small optimizations. I can't guarantee speed gain will be visible...
- void movieEvent(GSMovie m) {
- m.read();
- m.loadPixels();
-
- for (int j = 0; j < numPixels; j++) {
- for (int i = 0; i < numPixels; i++) {
- myMovieColors[j*numPixels + i] = m.get(i, j);
- }
- }
- }
get() is slow, and if you use it, you don't need loadPixels. But well, use the pixel array, since it is there... Wait, that's a GSMovie. Hmm... OK, a GSMovie is actually an (improved) PImage, so it is usable in the same way.
Actually, you can even go at full speed with something like:
- void movieEvent(GSMovie m) {
- m.read();
- m.loadPixels();
- arrayCopy(m.pixels, myMovieColors);
- }
(untested!)
Likewise, you can do small improvements in the draw() loop, by avoiding to do unnecessary operations:
- for (int j = 0; j < numPixels; j++) {
- for (int i = 0; i < numPixels; i++) {
- float z = brightness(myMovieColors[j*numPixels + i]);
- if (z < 220) { // No need to compute again brightness()!
- pushMatrix();
- translate(i,j,z);
- fill(myMovieColors[j*numPixels + i]);
- rect(i, j, blockSize, blockSize);
- popMatrix();
- }
- }
- }
Again, not tested, and not sure it is such a gain...