All pastes #979524 Raw Edit

Camera

public text v1 · immutable
·published 2008-04-10 12:46 UTC
rendered paste body
//Code for camera veiwing, made by Mr. Owl for use with the Processing code language, downloadable from Processing.org
float cameraZ = 75;
void setup(){
  size(200,200,P3D);
  noStroke();
}
void draw(){
  lights();
  background(0);
  //begin drawing, edit 3D objects starting here.
  fill(255,255,255);
  sphere(28);
  fill(0,153,119);
  box(50);
  //end drawing, do not edit 3D objects any more.
  camera(-(mouseX-width/2)*(cameraZ/abs(cameraZ)), -(mouseY-height/2), cameraZ, 0, 0, 0, 0, 1, 0);
}
void mouseClicked(){
  if(cameraZ==75.0){
    cameraZ=-75.0;
  }else{
    cameraZ=75.0;
  }
}