3D Coding on the Z-axis

here is an example

what is your specific question?

Chrisir




float angle1; 

void setup() {
  // init
  size(800, 600, P3D);
} // func 

void draw() {
  // runs on and on 
  background(0);
  lights();

  stroke(100); 
  //  noFill();
  fill(255, 0, 0);

  pushMatrix();
  translate(100, 100, 0);
  rotateZ(angle1);
  angle1+=.04; 
  box(60);
  popMatrix();

  pushMatrix();
  translate(400, 100, 0); 
  rotateX(angle1);
  fill(0, 0, 255);
  box(60);
  popMatrix();

  pushMatrix();
  translate(700, 100, 0);
  rotateY(angle1);
  box(60);
  popMatrix();

  pushMatrix();
  translate(700, 300, -330);
  noStroke(); 
  sphere(50);
  popMatrix();
} // func 
//
1 Like