Nebra Clock in Processing - need some help. I'm Processing newbee, I guess...
in
Programming Questions
•
2 years ago
Hi,
after some more'o'less cool Arduino projects:
I'm very interested in connecting Ardu with Processing. So I'm planning to send values from Arduino to Processing via serial port. Processing should draw a Nebra disc with a special angle (angle == hour). I'm using this prototype code to rotate the disc:
- float counter;
- PImage img;
- PImage imgw;
- byte hour;
- void setup()
- {
- hourcounter=0.0;
- size(500,500);
- img=loadImage("nebra.jpg");
- imgw=loadImage("wall.jpg");
- }
- void draw()
- {
- background(0);
- translate(width/2, height/2);
- rotate(((360/12)*(hourcounter+9))*TWO_PI/360); /// +9 to set moon to 0°/360°!
- translate(-img.width/2, -img.height/2);
- image(img,0,0);
- hourcounter++;
- if (hourcounter>=12) counter=0;
- delay(500);
- }
Looks like this:
My problem is: how to draw a second picture (wall.jpg) over Nebra disc without rotation angle? wall.jpg should be used as layer in front of Nebra disc. But: angle of wall must be 0°.
Is there any guy that can support me? Thank you very much!!! ;)
1