We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › webcam + ellipse drawing
Page Index Toggle Pages: 1
webcam + ellipse drawing (Read 933 times)
webcam + ellipse drawing
Nov 26th, 2009, 8:56am
 
hi all, i write a simple program that draw some ellipse by mouse movement, here is the program:


import processing.video.*;
Capture cap;

void setup()
{
 size(800,600);
 background(0);
 frameRate(30);

 cap = new Capture(this,width,height,15);
}        

void draw()
{
 image(cap,0,0);  
 ellipse(mouseX, mouseY,10,10);
}

void captureEvent(Capture c){
 c.read();
}


here is the problem..i also add webcam image into draw() function..so that there is only one ellipse follow the mouse movement(i want to draw many ellipse but the live webcam image should display in the same time, that means the ellipse must not be covered).can anybody tell me is it possible to achieve this?thanks.
Re: webcam + ellipse drawing
Reply #1 - Nov 26th, 2009, 9:23am
 
you can draw the ellipses into a Pgraphics and overlay it http://processing.org/reference/PGraphics.html

or i guess you can use the new Layer Librarie that was jsut relaesed
http://processing.org/discourse/yabb2/num_1259116487.html#1
Re: webcam + ellipse drawing
Reply #2 - Nov 26th, 2009, 12:03pm
 
nice one
Page Index Toggle Pages: 1