import org.gicentre.handy.*; // DECLARE A SPOUT OBJECT HERE import spout.*; // DECLARE A SPOUT OBJECT Spout spout; HandyRenderer hr; int SIZE_X = 800; int SIZE_Y = 200; int DISP_SEP = 5; int UNIT_SIZE = SIZE_X/DISP_SEP; //int UNIT_SIZE = 100; int[] x = new int[16]; int[] y = new int[16]; int[] z = new int[16]; ArrayList vList1; ArrayList vList2; ArrayList vList3; ArrayList vList4; ArrayList vColor1h; ArrayList vColor1s; void setup(){ size( 800, 200 ,P3D); textureMode(NORMAL); background( 255 ); // CREATE A NEW SPOUT OBJECT HERE spout = new Spout(this); // INITIALIZE A SPOUT SENDER HERE spout.setSenderName("vvvvideo"); hr = new HandyRenderer(this); hr = HandyPresets.createMarker(this); smooth(); strokeWeight(0.5); //h.setRoughness(2); hr.setFillGap(8); //h.setIsAlternating(true); vList1 = new ArrayList(); vList2 = new ArrayList(); vList3 = new ArrayList(); vList4 = new ArrayList(); vColor1h = new ArrayList(); vColor1s = new ArrayList(); noStroke(); colorMode( HSB, 360, 100, 100, 40 ); for (int k=0 ; k < 10 ; k++){ for( int i = 0; i < DISP_SEP; i++ ) { for( int j = 0; j < DISP_SEP; j++ ) { float drawPointX = UNIT_SIZE/4 + j * UNIT_SIZE; float drawPointY = UNIT_SIZE/4 + i * UNIT_SIZE; Float h = new Float(random(400)); Float s = new Float(random(120)); vColor1h.add(h); vColor1s.add(s); fill(h ,s , 80, 80 ); PVector vec1 = new PVector(drawPointX - random( UNIT_SIZE ), drawPointY - random( UNIT_SIZE )); PVector vec2 = new PVector(drawPointX + random( UNIT_SIZE ), drawPointY - random( UNIT_SIZE )); PVector vec3 = new PVector(drawPointX + random( UNIT_SIZE ), drawPointY + random( UNIT_SIZE )); PVector vec4 = new PVector(drawPointX - random( UNIT_SIZE ), drawPointY + random( UNIT_SIZE )); vList1.add(vec1); vList2.add(vec2); vList3.add(vec3); vList4.add(vec4); hr.quad( vec1.x, vec1.y, vec2.x, vec2.y,vec3.x, vec3.y, vec4.x, vec4.y ); } } } } void draw(){ for (int k=0 ; k < vList1.size() ; k++){ Float fColorH = vColor1h.get(k); Float fColorS = vColor1s.get(k); fill(fColorH ,fColorS , 80, 80 ); PVector vec1 = vList1.get(k); PVector vec2 = vList2.get(k); PVector vec3 = vList3.get(k); PVector vec4 = vList4.get(k); hr.quad( vec1.x, vec1.y, vec2.x, vec2.y,vec3.x, vec3.y, vec4.x, vec4.y ); } // SEND A SHARED TEXTURE HERE spout.sendTexture(); } void mousePressed() { String fileName = "randomQuadHandy" + day()+hour()+minute()+second()+".jpeg"; println("fileName:" + fileName); save(fileName); }