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 & HelpSyntax Questions › Timing controls on paint brush/ drawing programs
Page Index Toggle Pages: 1
Timing controls on paint brush/ drawing programs (Read 936 times)
Timing controls on paint brush/ drawing programs
Jan 5th, 2010, 9:55pm
 
In this sketch

http://openprocessing.org/visuals/?visualID=6838

I created a simple program and would like it to function like a drawing program for example like a Photo Shop brush.

How could I make the lines continues no matter how fast the speed of the mouse is going?

How can I make sure that any where the mouse has been that it draws the line as appropriate?

Could I make it draw the line with the mouse courser no matter how fast the mouse was moving consistantly across all computers?
Re: Timing controls on paint brush/ drawing programs
Reply #1 - Jan 5th, 2010, 11:59pm
 
Possibly lerp()
http://processing.org/reference/lerp_.html
Re: Timing controls on paint brush/ drawing programs
Reply #2 - Jan 6th, 2010, 1:41am
 
stopfocus wrote on Jan 5th, 2010, 9:55pm:
How could I make the lines continues no matter how fast the speed of the mouse is going

The usual way is to draw lines between each mouse coordinate you get. Might look not so nice if mouse moves really fast, but alternatives (like drawing Bézier curves) are much harder to code!

Quote:
How can I make sure that any where the mouse has been that it draws the line as appropriate

You cannot, because it also depends on the speed at which the system report the mouse positions, and you can add Java layer over that, and Processing layer too...

Quote:
Could I make it draw the line with the mouse courser no matter how fast the mouse was moving consistantly across all computers

Even harder... Smiley But I don't think you should be concerned by that, users rarely have different systems at hand, so they will get used to the behavior of their own system.
Page Index Toggle Pages: 1