Good evening to everyone and beg your pardon for my english. I'm new here even if it's a little while i'm working on Processing. In fact I use Processing to control arduino2009 board on my ROV, but I've only a problem to fix before I go to explore the abyss! On the front of the ROV there's a IPwebcam that I had to mount orizzontally to insert it into an acrilic cilynder. Webcam's video is correctly shown on my processing screen, but obviously it's 90 degrees clockwise rotated. I'm not able to turn the video counterclockwise, is there someone who can help me? (Of course i cannot mount webcam in other way because now i can rotate it to look up-forward-down). Every help is really really welcome! Thanks in advance. Andrew
PS: i put some lines of the program i've to improve with rotating 90deg counterclockwise, now it's only flips video horizontally.. (i'm not able to do more...)
Capture cam;
PImage camMirror;
void setup(){
size(640,480,P2D);
cam = new Capture(this,width,height,30);
cam.start();
camMirror = new PImage(cam.width,cam.height);
}
void draw(){
if(cam.available() == true){
cam.read();
}
cam.loadPixels();
//Mirroring the image
for(int x = 0; x < cam.width; x++){
for(int y = 0; y < cam.height; y++){
camMirror.pixels[x+y*cam.width] = cam.pixels[(cam.width-(x+1))+y*cam.width];
}
}
camMirror.updatePixels();
image(camMirror,0,0);
}