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.
IndexDiscussionExhibition › Processing with live interaction
Page Index Toggle Pages: 1
Processing with live interaction (Read 939 times)
Processing with live interaction
Oct 26th, 2007, 3:48pm
 
Hi all,

I'm totally new at Processing.

My question: is it possible to have a person interact (through a device, be it mouse, joystick, or …) with an applet?

My rough idea is to have a projection on walls and ceiling that would change as a user moves a device.

Can you suggest means to do that?

Thx!
Re: Processing with live interaction
Reply #1 - Oct 31st, 2007, 11:31pm
 
the variables mouseX and mouseY always contain the values of where the cursor is. The variables pmouseX and pmouseY contain the previous value of the cursor position. For instance, to draw continuous lines, try this program:

Code:
 
void setup () {
stroke(0);
};

//above sets the color of the line

void draw () {
line(mouseX,mouseY,pmouseX,pmouseY);
};


There are infinite variations on this small program that really is purely user-controlled.

Hope this helps Smiley
Page Index Toggle Pages: 1