/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.5-qKt4qGpne/rev.330
*
* authors:
* Hans Biebinger
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
int BoxPosX=0;
int BoxPosY=80;
int BoxPosZ=0;
int winkel=0;
void setup() {
size(400, 400, OPENGL);
frameRate(10);
fill(128);
stroke(255);
lights();
}
void draw() {
background(0);
camera(0,0,-700,0,0,0,0,1,0);
translate(BoxPosX,BoxPosY,BoxPosZ);
winkel++;
rotateY(radians(winkel++));
sphere(100);
}
void keyPressed() {
if (keyCode==DOWN) {
BoxPosZ=BoxPosZ-10;
}
if (keyCode==UP) {
BoxPosZ=BoxPosZ+10;
}
if (keyCode==LEFT) {
BoxPosX=BoxPosX+10;
}
if (keyCode==RIGHT) {
BoxPosX=BoxPosX-10;
}
}