Hello all,
I am interested in creating an object that I want to use to hold videos/ or images within but am having great trouble in creating the framework of it.
After looking at multiple forums and posts, I can’t seem to try to figure out the code to what I want to create.
The image of what I want to create attached:
The code offers the tiles, but not in the sequence of form I want it to take. I know I need to limit the number of tiles but I am not sure to scale the number of tiles from the top to bottom using the same amount of 5 tiles or how to add the frame around it to make it look as an closed sphere.
function setup() {
createCanvas(640, 640, WEBGL);
}
function draw() {
background(0);
//Next emulates yaw motion from Processing's PeasyCam environment
rotateY(map(mouseX, -width/2, width/2, -PI, PI));
for (var theta = 0; theta <360; theta+=20) {
for (var phi = 0; phi <360; phi+=15) {
push();
rotateY(radians(theta));
rotateX(radians(phi));
translate(0, 0, 300);
noStroke();
fill(255, 0, 0);
box(50, 50, 2);
pop();
}
}
stroke(3);
fill(255);
box(8, 10, 2);
//popMatrix();
push();
translate(45, 5, 5);
fill(250, 250, 25);
box(90, 5, 5);
pop();
push();
translate(5, 45, 5);
fill(25, 250, 25);
box(5, 90, 5);
pop();
push();
translate(5, 5, 45);
fill(25, 25, 250);
box(5, 5, 90);
pop();
}