I attempted to map data from external devices to draw patterns. But the oscP5 library and P3D renderer could not work together in processing both 3.3.7 and 3.4 while they can work separately. They can work in processing 2.2.1 but 2.2.1 doesn't support the sound library. Any one knows how to solve it?
import oscP5.*;
OscP5 oscP5;
float value;
void setup(){
size(400, 400, P3D);
rectMode(CENTER);
oscP5 = new OscP5(this, 60000);
}
void oscEvent(OscMessage theOscMessage){
if (theOscMessage.checkAddrPattern("/ATT")){
value = theOscMessage.get(0).floatValue();
}
}
void draw(){
background(0);
noStroke();
fill(255);
float r = second()/10;
rotateZ(r);
rect(width/2, height/2, value, value);
}
I solved the problem. In my original code there is a frameRate initialisation in setup() (minimal example showed below), I didn't realise that it's it that caused the problem (cause the frameRate initialisation causes no error when it works with oscP5 or P3D respectively) so I didn't write it in my question. Now I deleted the frameRate initialisation line (frameRate(30)) then oscP5 and P3D can finnaly work together (even I'm still confused but it doesn't affect my current work).
Hope that I explained clearly. :)