|
|
@ -54,6 +54,17 @@ PGraphics sphere; |
|
|
|
|
|
|
|
int tilesOverlap; |
|
|
|
|
|
|
|
// testPicture |
|
|
|
boolean testPictureToggle = false; |
|
|
|
PFont testFont; |
|
|
|
|
|
|
|
// fps |
|
|
|
PFont fpsFont; |
|
|
|
|
|
|
|
// testPattern |
|
|
|
boolean testPatternToggle = false; |
|
|
|
|
|
|
|
|
|
|
|
void setup() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
|
|
|
|
|
|
float sizefactor = 1; // define the size of the screen, 1 = 1080p |
|
|
@ -73,7 +84,8 @@ void setup() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
|
|
// start oscP5, listening for incoming messages at port 12000 |
|
|
|
println("~~~ starting oscP5 ..."); |
|
|
|
oscP5 = new OscP5(this,12000); |
|
|
|
oscP5.plug(this,"ctlin","/ctlin"); // to be converted for PD OSC input |
|
|
|
oscP5.plug(this,"ctlin","/ctlin"); // osc from Renoise/Midi (via SC) -> function 'ctlin' |
|
|
|
oscP5.plug(this,"scosc","/sc"); // osc from SuperCollider -> function 'scosc' |
|
|
|
|
|
|
|
// get all textures into an image pool |
|
|
|
println("\n\n~~~ loading textures into image pool ...\n"); |
|
|
@ -109,33 +121,18 @@ void setup() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
|
|
initializeSphere(ptsW, ptsH); // number of vertices around the width and height |
|
|
|
sphere = createGraphics(width, height, P3D); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// process OSC messages |
|
|
|
public void ctlin(int cc, int val) { // - - - - - - - - - - - - - - - - - - - - - - - |
|
|
|
|
|
|
|
// debug |
|
|
|
println("## OSC: /ctlin cc:" + cc + " value:" + val); |
|
|
|
// for testPicture |
|
|
|
String[] fontList = PFont.list(); |
|
|
|
printArray(fontList); |
|
|
|
testFont = createFont("Oliver's Barney", 50); |
|
|
|
|
|
|
|
if (cc == 2) { tilesOverlap = val; } |
|
|
|
// fps |
|
|
|
fpsFont = createFont("Ubuntu Mono", 12); |
|
|
|
|
|
|
|
/* // triggers are on controller number 0 |
|
|
|
if (cc == 0) { |
|
|
|
} |
|
|
|
|
|
|
|
if (cc == 2) { flySpeedXfactor = (val - 64); } // speed (&direction) on X axis [-1 - 1] FIXit! |
|
|
|
if (cc == 3) { flySpeedYfactor = (val - 64); } // speed (&direction) on Y axis [-1 - 1] FIXit! |
|
|
|
*/ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void draw() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
|
|
|
|
|
|
// clean screen ````````````````````````````````````````````````````| |
|
|
@ -184,7 +181,7 @@ void draw() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
|
|
|
|
|
|
|
|
|
|
// test pattern```````````````````````````````````````````````````| |
|
|
|
testPattern(boolean(0), // on/off |
|
|
|
testPattern(testPatternToggle, // boolean(0), // on/off |
|
|
|
2, 0, // img bank & ID |
|
|
|
255, // image alpha |
|
|
|
10, // number of horizontal 'lanes' |
|
|
@ -197,7 +194,7 @@ void draw() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
|
|
|
|
|
|
// debug `````````````````````````````````````````````````````````| |
|
|
|
// draw test picture |
|
|
|
testPicture(boolean(0)); |
|
|
|
testPicture(testPictureToggle); |
|
|
|
|
|
|
|
// frames per second |
|
|
|
displayFps(true); |
|
|
|