xxxxxxxxxx
function preload() {
f = loadFont('https://cdnjs.cloudflare.com/ajax/libs/ink/3.1.10/fonts/Roboto/roboto-regular-webfont.ttf');
}
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
pixelDensity(2);
perspective(22 * PI/180, width/height, 0.01, 22.55);
easycam = createEasyCam({distance:12.5});
document.oncontextmenu = function() { return false; }
document.onmousedown = function() { return false; }
textFont(f);
textSize(0.1);
strokeWeight(0.005);
}
function draw() {
if(!easycam) return;
background(100);
fill(255);
stroke(0);
beginShape(); // base pentagon 1
vertex(-1.618033989, 0, 0.618033989); // A
push();
translate(-1.618033989, 0, 0.618033989);
text("A", -.1,0);
pop();
vertex(-1.618033989, 0, -0.618033989); // B
push();
translate(-1.618033989, 0, -0.618033989);
text("B", -.1,0);
pop();
vertex(-1, -1, -1); // 1
push();
translate(-1, -1, -1);
text("1", -.1,0);
pop();
vertex(-0.618033989, -1.618033989, 0); // C
push();
translate(-0.618033989, -1.618033989, 0);
text("C", -.1,0);
pop();
vertex(-1, -1, 1); // 2
push();
translate(-1, -1, 1);
text("2", -.1,0);
pop();
endShape(CLOSE);
beginShape(); // base pentagon 2
vertex(1.618033989, 0, 0.618033989); // D
vertex(1.618033989, 0, -0.618033989); // E
vertex(1, 1, -1); // 3
push();
translate(1, 1, -1);
text("3", .05,0);
pop();
vertex(0.618033989, 1.618033989, 0); // F
vertex(1, 1, 1); // 4
push();
translate(1, 1, 1);
text("4", .05,0);
pop();
endShape(CLOSE);
beginShape(); // connect to 2
vertex(1.618033989, 0, 0.618033989); // D
push();
translate(1.618033989, 0, 0.618033989);
text("D", .05,0);
pop();
vertex(1.618033989, 0, -0.618033989); // E
push();
translate(1.618033989, 0, -0.618033989);
text("E", .05,0);
pop();
vertex(1, -1, -1); // 5
push();
translate(1, -1, -1);
text("5", .05,0);
pop();
vertex(0.618033989, -1.618033989, 0); // G
push();
translate(0.618033989, -1.618033989, 0);
text("G", .05,0);
pop();
vertex(1, -1, 1); // 6
push();
translate(1, -1, 1);
text("6", .05,0);
pop();
endShape(CLOSE);
beginShape(); // connect to 1
vertex(-1.618033989, 0, 0.618033989); // A
vertex(-1.618033989, 0, -0.618033989); // B
vertex(-1, 1, -1); // 7
push();
translate(-1, 1, -1);
text("7", -.1,0);
pop();
vertex(-0.618033989, 1.618033989, 0); // H
push();
translate(-0.618033989, 1.618033989, 0);
text("H", -.1,0);
pop();
vertex(-1, 1, 1); // 8
push();
translate(-1, 1, 1);
text("8", -.1,0);
pop();
endShape(CLOSE);
beginShape(); //
vertex(0, 0.618033989, 1.618033989); // I
vertex(0, -0.618033989, 1.618033989); // J
vertex(-1, -1, 1); // 2
vertex(-1.618033989, 0, 0.618033989); // A
vertex(-1, 1, 1); // 8
endShape(CLOSE);
beginShape(); //
vertex(0, 0.618033989, -1.618033989); // K
push();
translate(0, 0.618033989, -1.618033989-.1);
text("K", 0,0);
pop();
vertex(0, -0.618033989, -1.618033989); // L
push();
translate(0, -0.618033989, -1.618033989-.1);
text("L", 0,0);
pop();
vertex(-1, -1, -1); // 1
vertex(-1.618033989, 0, -0.618033989); // B
vertex(-1, 1, -1); // 7
endShape(CLOSE);
beginShape(); //
vertex(0, 0.618033989, -1.618033989); // K
vertex(0, -0.618033989, -1.618033989); // L
vertex(1, -1, -1); // 5
vertex(1.618033989, 0, -0.618033989); // E
vertex(1, 1, -1); // 3
endShape(CLOSE);
fill(0,0,127,63);
stroke(0,0,127);
box(1.99);
}