float boxw = 236; float boxh = 60; float w = boxw / 21; float h = boxh / 3; void setup() { size(400, 200, OPENGL); textAlign(CENTER, CENTER); } void draw() { background(0); pushMatrix(); translate(width/2, height/2, -50); rotateY(map(mouseX, 0, width, -1, 2)); rotateX(map(mouseY, 0, width, 8, -8)); fill(150); stroke(0); box(boxw, boxh, boxh); fill(100); stroke(100); strokeWeight(2); pushMatrix(); translate(-boxw / 2, -boxh / 2, boxh / 2 + 1); drawS3(); drawO3(); drawL3(); drawU3(); drawB3(); drawL3(); drawE3(); popMatrix(); rotateX(-PI/2); pushMatrix(); translate(-boxw / 2, -boxh / 2, boxh / 2 + 1); drawProblems(); popMatrix(); //text("SOULUBLE",0,-4,31); rotateX(-PI/2); pushMatrix(); translate(-boxw / 2, -boxh / 2, boxh / 2 + 1); drawI1(); drawN3(); drawE2(); drawV2(); drawI1(); drawT3(); drawA2(); drawB3(); drawL2(); drawE2(); popMatrix(); rotateX(-PI/2); pushMatrix(); translate(-boxw / 2, -boxh / 2, boxh / 2 + 1); drawProblems(); popMatrix(); rotateX(-PI/2); noStroke(); fill(100); rotateY(PI/2); pushMatrix(); translate(0, 0, 119); ellipse(0, 0, 40, 40); popMatrix(); pushMatrix(); translate(0, 0, -119); ellipse(0, 0, 40, 40); popMatrix(); //text(,0,0); popMatrix(); } void drawProblems(){ drawP3(); drawR3(); drawO2(); drawB3(); drawL2(); drawE2(); drawM3(); drawS3(); } void rek(float x, float y) { noFill(); rect(w*x,h*y,w,h); fill(100); } void clearrek(float x, float y) { rek(x,y); //fill(255); // rect(w*x,h*y,200,200); // fill(100); // stroke(100); } void outer3() { line(0, 0, w*3, 0); line(w*3, 0, w*3, h*3); line(w*3, h*3, 0, h*3); line(0, h*3, 0, 0); translate(w*3, 0); } void outer2() { line(0, 0, w*2, 0); line(w*2, 0, w*2, h*3); line(w*2, h*3, 0, h*3); line(0, h*3, 0, 0); translate(w*2, 0); } void outer1() { line(0, 0, w, 0); line(w, 0, w, h*3); line(w, h*3, 0, h*3); line(0, h*3, 0, 0); translate(w, 0); } void hcut(float x, float y){ line(x*w,y*h,(x+1)*w,y*h); } void vcut(float x, float y){ line(x*w,y*h,x*w,(y+1)*h); } void triSW(float x, float y){ triangle(x*w,y*h,x*w,(y+1)*h,(x+1)*w,(y+1)*h); } void triNE(float x, float y){ triangle(x*w,y*h,(x+1)*w,y*h,(x+1)*w,(y+1)*h); } void triSE(float x, float y){ triangle((x+1)*w,y*h,x*w,(y+1)*h,(x+1)*w,(y+1)*h); } void triNW(float x, float y){ triangle(x*w,y*h,(x+1)*w,y*h,x*w,(y+1)*h); } void drawP3() { clearrek(1,2); clearrek(2,2); hcut(1,1); outer3(); } void drawR3() { //triangle(w*2, h*2, w*3, h*2, w*3, h*3); // triangle(w, h*2, w*2, h*3, w, h*3); triSW(1,2); triNE(2,2); hcut(1,1); outer3(); } void drawO2() { vcut(1,1); outer2(); } void drawB3() { triNE(2,0); // triSE(2,2); line(w, h, w*2, h); line(w, h*2, w*2, h*2); outer3(); } void drawL2() { rek(1, 0); rek(1, 1); outer2(); } void drawE2() { hcut(1,1); hcut(1,2); outer2(); } void drawM3() { vcut(1.5,0); vcut(1,2); vcut(2,2); outer3(); } void drawS3() { triNW(0,0); triSW(0,1); triNE(2,1); triSE(2,2); outer3(); } void drawI1(){ outer1(); } void drawN3(){ triNE(1,0); triSW(1,2); outer3(); } void drawV2(){ triSW(0,2); triSE(1,2); vcut(1,0); vcut(1,1); outer2(); } void drawT3(){ rek(0,1); rek(0,2); rek(2,1); rek(2,2); outer3(); } void drawA2(){ hcut(.5,1); vcut(1,2); outer2(); } void drawO3(){ triNW(0,0); triNE(2,0); triSE(2,2); triSW(0,2); vcut(1.5,1); outer3(); } void drawL3(){ clearrek(1,0); clearrek(2,0); clearrek(1,1); clearrek(2,1); outer3(); } void drawU3(){ rek(1,0); rek(1,1); outer3(); } void drawE3(){ hcut(1,1); hcut(2,1); hcut(1,2); hcut(2,2); outer3(); }