fractalkitty looking for math? fractalkitty.com

Genuary 2022

There's Space in this Box

#image#3d#interactive#animation#space#genuary

spacecardboard

let space;
let cardboard;
function preload() {
  space = loadImage("/assets/starmap_4k.jpeg");
  cardboard = loadImage("/assets/cardboard.JPG");
}
function setup() {//setting things up here
  createCanvas(windowWidth, windowHeight, WEBGL);
  noStroke();
  smooth();
}
function draw() {
  background(255);
  orbitControl();
  rotateX(-PI / 6);
  texture(space);
  push();
  rotateX(frameCount / 200);
  rotateY(frameCount / 200);
  rotateZ(frameCount / 200);
  sphere(width / 6, 50, 50);
  pop();
  texture(cardboard);
  push();
  translate(0, 0, width / 6);
  plane(width / 3, width / 3);
  pop();
  push();
  translate(0, 0, -width / 6);
  plane(width / 3, width / 3);
  pop();
  push();
  translate(0, width / 6, 0);
  rotateX(PI / 2);
  plane(width / 3, width / 3);
  pop();
  push();
  translate(width / 6, 0, 0);
  rotateY(PI / 2);
  plane(width / 3, width / 3);
  pop();
  push();
  translate(-width / 6, 0, 0);
  rotateY(PI / 2);
  plane(width / 3, width / 3);
  pop();
}
function windowResized() {//can't you sit still? Do you really need to change the window?
  setup();
  draw();
}