int scaleFactor = 200; float triangleScale = .62; float rayFactor = .08; float rotFactor = PI; boolean showFactors = false; void setup() { size( 600, 600 ); smooth(); PFont font = loadFont( "Aharoni-Bold-48.vlw" ); textFont( font, 24 ); } void draw() { drawLogo(); if ( showFactors ) { drawFactors(); } } void drawLogo() { background(255); fill( 0 ); stroke( 0 ); translate( width/2, height/2 ); rotate( rotFactor ); // Hexagon beginShape(); float hexX = cos( PI / 6 ) * scaleFactor; float hexY = sin( PI / 6 ) * scaleFactor; vertex( 0, scaleFactor ); vertex( hexX, hexY ); vertex( hexX, -hexY ); vertex( 0, -scaleFactor ); vertex( -hexX, -hexY ); vertex( -hexX, hexY ); endShape(); // Triangle fill( 255 ); stroke( 255 ); beginShape(); vertex( 0, scaleFactor * triangleScale ); vertex( hexX * triangleScale, -hexY * triangleScale ); vertex( -hexX * triangleScale, -hexY * triangleScale ); endShape(); // Rays fill( 255 ); stroke( 255 ); rectMode( CENTER ); rect( 0, 0, rayFactor * scaleFactor, scaleFactor * 2 + 5 ); rotate( PI / 3 ); rect( 0, 0, rayFactor * scaleFactor, scaleFactor * 2 + 5 ); rotate( PI / 3 ); rect( 0, 0, rayFactor * scaleFactor, scaleFactor * 2 + 5 ); rotate( -2 * PI / 3 ); } void drawFactors() { fill( 0 ); rotate( -rotFactor ); text( "Scale: " + scaleFactor, -width / 2 + 10, -height / 2 + 20 ); text( "Tri scale: " + triangleScale, -width / 2 + 10, -height / 2 + 40 ); text( "Ray width: " + rayFactor, -width / 2 + 10, -height / 2 + 60 ); } void keyPressed() { switch ( keyCode ) { case ENTER: showFactors = !showFactors; break; case RIGHT: rayFactor += 0.01; break; case LEFT: rayFactor -= 0.01; if ( rayFactor < 0 ) { rayFactor = 0; } break; case UP: triangleScale += 0.01; break; case DOWN: triangleScale -= 0.01; if ( triangleScale < 0 ) { triangleScale = 0; } break; case ' ': rotFactor += PI / 6; break; } }