Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Using quads for projection mapping

$
0
0

Hi! I'm trying to integrate this Quad library/ sample sketch with my own GIF generator but it keeps breaking (Null Pointer Exception)

I'm wondering if that's because the image needs to be loaded in Setup and can't be reloaded/ refreshed in Draw?

Gif Code below

PImage loopingGif=null;
//ThinkGearSocket neuroSocket;
int attention=10;
int meditation=10;

PFont font;
int rand;
int interval = 400; //timer's interval
int lastRecordedTime = -12220;


void setup() {
}


void draw() {


  if (millis()-lastRecordedTime>interval) {
    println("here");
    if (attention<=30) {
      rand = int(random(1, 5));
      String fn= ((rand) + ".gif");
      //loopingGif = new Gif(this, fn);
      //loopingGif.loop();
      lastRecordedTime= millis();
    } else {
      rand = int(random(5, 9));
      String fn= ((rand) + ".gif");
      println (fn);
      //loopingGif = new Gif(this, fn);
      //loopingGif.loop();
      lastRecordedTime= millis();
    }
  } else {
    // image(loopingGif, 0, 0);
    println("show");
    // lastRecordedTime= millis();
  }
}

Viewing all articles
Browse latest Browse all 2896

Trending Articles