commit c6432e4a6a2532f1bed3c84c72fce2375ba6481f Author: vaporvee Date: Sun Oct 13 18:57:02 2024 +0200 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e145534 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# I hate my browser +debug.log \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..260efcd Binary files /dev/null and b/README.md differ diff --git a/hello_world.pde b/hello_world.pde new file mode 100644 index 0000000..dab4cc2 --- /dev/null +++ b/hello_world.pde @@ -0,0 +1,75 @@ +float angleY = 0; +float rotationValue = 0.05; + +void setup() { + print("Hello World!"); + size(1280, 720, P3D); + noStroke(); +} + +void draw() { + background(0); + PGraphics codeWindow = createCodeWindow(); + translate(width / 2, height / 2, 0); + rotateY(angleY); + drawCube(codeWindow); + if (Math.round(angleY) == 1 || Math.round(angleY) == -1 || angleY == 0) { // Rotation turn change + rotationValue = rotationValue * -1; + } + angleY += radians(rotationValue); +} + +void drawCube(PGraphics codeWindow) { + float cubeHeight = 200; + float cubeWidth = cubeHeight * 1.5; // Adjusting width to match aspect ratio of 1080:720 + + beginShape(); + texture(codeWindow); + vertex(-cubeWidth, -cubeHeight, cubeHeight, 0, 0); + vertex(cubeWidth, -cubeHeight, cubeHeight, codeWindow.width, 0); + vertex(cubeWidth, cubeHeight, cubeHeight, codeWindow.width, codeWindow.height); + vertex(-cubeWidth, cubeHeight, cubeHeight, 0, codeWindow.height); + endShape(CLOSE); +} + +PGraphics createCodeWindow() { + PGraphics pg = createGraphics(1280, 720); + pg.beginDraw(); + + pg.fill(240); + pg.rect(100, 75, 1080, 50, 20, 20, 0, 0); + + pg.noStroke(); + pg.fill(255, 0, 0); // Red button + pg.ellipse(120, 100, 15, 15); + pg.fill(255, 204, 0); // Yellow button + pg.ellipse(145, 100, 15, 15); + pg.fill(0, 255, 0); // Green button + pg.ellipse(170, 100, 15, 15); + + pg.fill(30, 30, 30); + pg.rect(100, 120, 1080, 480, 0, 0, 20, 20); + + int tSize = 40; + pg.textSize(tSize); + pg.textAlign(LEFT); + + pg.fill(150, 150, 150); + pg.text("1", 130, 190); + pg.fill(86, 156, 214); + pg.text("print", 180, 190); + pg.fill(255, 255, 255); + pg.text("(", 265, 190); + pg.fill(206, 145, 120); + pg.text("\"Hello World\"", 280, 190); + pg.fill(255, 255, 255); + pg.text(")", 512, 190); + + if (frameCount % 60 < 30) { + pg.fill(255); + pg.rect(530, 155, 3, 45); + } + + pg.endDraw(); + return pg; +}