From 5ba652fc167a8655b718306aaa0813858f0e2937 Mon Sep 17 00:00:00 2001 From: mmattmcw Date: Fri, 30 Jul 2021 00:54:00 -0400 Subject: [PATCH] Sketch for evaluating the size of the frame these scripts generate --- left_right/left_right.pde | 1 - left_right_size/.gitignore | 2 ++ left_right_size/left.svg | 37 +++++++++++++++++++++++ left_right_size/left_right_size.pde | 46 +++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 left_right_size/.gitignore create mode 100644 left_right_size/left.svg create mode 100644 left_right_size/left_right_size.pde diff --git a/left_right/left_right.pde b/left_right/left_right.pde index 5eb2c92..59fa457 100644 --- a/left_right/left_right.pde +++ b/left_right/left_right.pde @@ -30,7 +30,6 @@ void draw() { beginRaw(SVG, "left.svg"); stroke(255, 0, 0, 124); drawBox(50, 50, 0); - text(); endRaw(); camera(70.0 - (EYE / 2), 35.0, 120.0, 50.0, 50.0, 35.0 / 2, diff --git a/left_right_size/.gitignore b/left_right_size/.gitignore new file mode 100644 index 0000000..cac4909 --- /dev/null +++ b/left_right_size/.gitignore @@ -0,0 +1,2 @@ +.png +.svg diff --git a/left_right_size/left.svg b/left_right_size/left.svg new file mode 100644 index 0000000..cbf2c95 --- /dev/null +++ b/left_right_size/left.svg @@ -0,0 +1,37 @@ + + + diff --git a/left_right_size/left_right_size.pde b/left_right_size/left_right_size.pde new file mode 100644 index 0000000..f4fed1c --- /dev/null +++ b/left_right_size/left_right_size.pde @@ -0,0 +1,46 @@ +PImage img; +import processing.svg.*; + +float EYE = 5.0; +int X = 50; +int Y = 50; +int Z = -10; + +void settings() { + System.setProperty("jogl.disable.openglcore", "false"); + size(900, (900 / 4) * 3, P3D); +} + +void setup() { + noLoop(); + background(#ffffff); + noFill(); + strokeWeight(2); +} + +void drawBox (int x, int y, int z) { + push(); + translate(x, y, z); + box(45, 45, (45 / 4) * 3); + pop(); +} + +void draw() { + background(#ffffff); + camera(70.0 + (EYE / 2), 35.0, 120.0, 50.0, 50.0, 35.0 / 2, + 0.0, 1.0, 0.0); + beginRaw(SVG, "left_size.svg"); + stroke(255, 0, 0, 124); + drawBox(X, Y, Z); + endRaw(); + + camera(70.0 - (EYE / 2), 35.0, 120.0, 50.0, 50.0, 35.0 / 2, + 0.0, 1.0, 0.0); + //background(#ffffff); + beginRaw(SVG, "right_size.svg"); + stroke(0, 0, 255, 124); + drawBox(X, Y, Z); + endRaw(); + + save("left_right_size.png"); +}