Sketch for evaluating the size of the frame these scripts generate

This commit is contained in:
Matt McWilliams 2021-07-30 00:54:00 -04:00
parent 10d86c56bf
commit 5ba652fc16
4 changed files with 85 additions and 1 deletions

View File

@ -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,

2
left_right_size/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.png
.svg

37
left_right_size/left.svg Normal file
View File

@ -0,0 +1,37 @@
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
<svg xmlns:xlink="http://www.w3.org/1999/xlink" style="fill-opacity:1; color-rendering:auto; color-interpolation:auto; text-rendering:auto; stroke:black; stroke-linecap:square; stroke-miterlimit:10; shape-rendering:auto; stroke-opacity:1; fill:black; stroke-dasharray:none; font-weight:normal; stroke-width:1; font-family:'Dialog'; font-style:normal; stroke-linejoin:miter; font-size:12px; stroke-dashoffset:0; image-rendering:auto;" width="900" height="675" xmlns="http://www.w3.org/2000/svg"
><!--Generated by the Batik Graphics2D SVG Generator--><defs id="genericDefs"
/><g
><g style="fill:rgb(255,0,0); fill-opacity:0.4863; stroke-width:2; stroke-opacity:0.4863; stroke-linecap:round; stroke:rgb(255,0,0);"
><line y2="395.429" style="fill:none;" x1="401.1658" x2="403.1526" y1="224.4458"
/></g
><g style="fill:rgb(255,0,0); fill-opacity:0.4863; stroke-width:2; stroke-opacity:0.4863; stroke-linecap:round; stroke:rgb(255,0,0);"
><line y2="404.6245" style="fill:none;" x1="403.1526" x2="574.9435" y1="395.429"
/><line y2="222.4419" style="fill:none;" x1="574.9435" x2="580.6024" y1="404.6245"
/><line y2="224.4458" style="fill:none;" x1="580.6024" x2="401.1658" y1="222.4419"
/><line y2="216.4853" style="fill:none;" x1="357.9618" x2="353.0051" y1="431.6608"
/><line y2="213.1935" style="fill:none;" x1="353.0051" x2="580.8895" y1="216.4853"
/><line y2="446.4144" style="fill:none;" x1="580.8895" x2="573.6455" y1="213.1935"
/><line y2="431.6608" style="fill:none;" x1="573.6455" x2="357.9618" y1="446.4144"
/><line y2="404.6245" style="fill:none;" x1="580.6024" x2="574.9435" y1="222.4419"
/><line y2="446.4144" style="fill:none;" x1="574.9435" x2="573.6455" y1="404.6245"
/><line y2="213.1935" style="fill:none;" x1="573.6455" x2="580.8895" y1="446.4144"
/><line y2="222.4419" style="fill:none;" x1="580.8895" x2="580.6024" y1="213.1935"
/><line y2="224.4458" style="fill:none;" x1="403.1526" x2="401.1658" y1="395.429"
/><line y2="216.4853" style="fill:none;" x1="401.1658" x2="353.0051" y1="224.4458"
/><line y2="431.6608" style="fill:none;" x1="353.0051" x2="357.9618" y1="216.4853"
/><line y2="395.429" style="fill:none;" x1="357.9618" x2="403.1526" y1="431.6608"
/><line y2="213.1935" style="fill:none;" x1="580.6024" x2="580.8895" y1="222.4419"
/><line y2="216.4853" style="fill:none;" x1="580.8895" x2="353.0051" y1="213.1935"
/><line y2="224.4458" style="fill:none;" x1="353.0051" x2="401.1658" y1="216.4853"
/><line y2="222.4419" style="fill:none;" x1="401.1658" x2="580.6024" y1="224.4458"
/><line y2="431.6608" style="fill:none;" x1="403.1526" x2="357.9618" y1="395.429"
/><line y2="446.4144" style="fill:none;" x1="357.9618" x2="573.6455" y1="431.6608"
/><line y2="404.6245" style="fill:none;" x1="573.6455" x2="574.9435" y1="446.4144"
/><line y2="395.429" style="fill:none;" x1="574.9435" x2="403.1526" y1="404.6245"
/></g
></g
></svg
>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -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");
}