hello i need help controlling my processing document with arduino controls. the processing document is a 3D etch a sketch, below is the processing code :
import processing.opengl.*;
int x, y, z;
int speed = 10;
//PImage etch;
void setup() {
size(900, 630, OPENGL);
background(255, 255, 255);
}
void draw() {
// background(255, 255, 255);
lights();
pushMatrix();
translate(width/2, height/2);
noFill();
box(450);
translate(width/12, height/12);
translate(x, y, z);
strokeWeight(2);
stroke(128);
sphere(5);
strokeWeight(2);
stroke(5);
noFill();
smooth();
strokeWeight(10.0);
strokeJoin(MITER);
beginShape();
vertex(35, 20);
vertex(65, 50);
vertex(35, 80);
//endShape();
popMatrix();
}
void keyPressed() {
if (keyCode == UP) {
y-=speed;
}
if (keyCode == DOWN) {
y+=speed;
}
if (keyCode == LEFT) {
x-=speed;
}
if (keyCode == RIGHT) {
x+=speed;
}
if (keyCode == SHIFT) {
z+=speed;
}
if (keyCode == CONTROL) {
z-=speed;
}
}
so there question is how do i make the arduino control the etch a sketch / please help