We are about to switch to a new forum software. Until then we have removed the registration on this forum.
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();
}
}
Answers
@Chrisir any ideas? X_X
you join two sketches
show your attempt
where is the npe?
Progress has been made- I merged it and it works but when I try to delete the extra Quads (0-3) I get NullPointerExceptions
There are two other Tabs in the sketch
"PROJECTED QUADS"
And "QUADS"
As well as a quads-config.txt which contains this
I think you're far more advanced than I am
what is projection mapping btw.
in which line does the error occur (tab and line number?)
what do the numbers in the txt-file mean? Do 4 numbers together define one quad? Like those:
200.0 150.0 431.0 88.0
remark : to display them better , you might want to go back and edit your post, select them and hit ctrl-o (as you would with code, you know?)
200.0 150.0 431.0 88.0 671.0 121.0 417.0 224.0 200.0 150.0 417.0 224.0 426.0 552.0 212.0 427.0 417.0 224.0 671.0 121.0 659.0 417.0 426.0 552.0
Best, Chrisir ;-)
[Fixed data]
this codes needs a bunch of animated gif files called 0.gif to 12.gif
no hyphen in the name!
i get an immediate npe in processing 2, jogamp having problem with texture.