hi felix,
to draw on top of a video, simply draw the video first (image()), and then draw the things that should appear on top. youre code raws the lines, and overpaints it with the video image, so no lines are visible.
Your history line code seems to be buggy though. Consider that an array [] has a fixed size. you must create a list like this befor you can access the list elements:
int[] histX = new int[4];
You could use mousePressed() and mouseReleased() events to hanlde the filling/reseting of your history arrays. Also have a look at expand() or append() which will let you enlarge the history arrays when needed.
here is a basic example of drawing over video.
Quote:
import processing.video.*;
Capture video;
void setup() {
size(640, 480);
video = new Capture(this, width, height, 30);
smooth();
stroke(0, 0, 0, 255);
strokeWeight(8);
}
void draw() {
if (video.available()) {
video.read();
}
// image must come first, so it does not overpaint the stuff you draw.
image(video, 0, 0, width, height);
// draw stuff on top
for(int i=0; i<10; i++) {
line(random(width), random(height), mouseX, mouseY);
}
}