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 › constant lines on screen
Page Index Toggle Pages: 1
constant lines on screen (Read 589 times)
constant lines on screen
Dec 19th, 2009, 1:02pm
 
Hello

How can I display constatnt shape generared from x,y coordinate 2D  array? Do I understand correctly that to keep something constant on the screen I need to rebuild it constantly on " void draw()"  loop?

Processing is very rich on fucntions, for beginner it' s difficult to choose the right one. Is there a function to quickly draw shape from 2d array? (Scribble example got me totally confused)

Thank you in advance

Janis

P.S. That's the same "radar"  case. I' m getting from network server (Linksys router on wheels, Arduino, servo, Ping)) sensor) stream of angle and distance measurments. I want to have nice chart on Processing screen after each 180deg scan.  If "background(anything)"  is used in code and I draw multiple lines on screen I can breefly see only one line, but moving. If I don' t use background() then all lines are shown on screen (that is what I need). But then I have other undesirable effects - moving line() I use to indicate joystick position is never redrawn. Messy.

BUT. In examples/topics/drawing/continuouslines example there is background(102) used, and old coordinates are not stored anywhere, but all previous mouse movements are not erased. I' m confused. And how to erase them if I don' t need them anymore?
Re: constant lines on screen
Reply #1 - Dec 20th, 2009, 12:17am
 
In the example, background is done in the setup method. So it is done only once.

Do you receive data continuously from your arduino, or does it send all the data at the end of the scan?
Re: constant lines on screen
Reply #2 - Dec 20th, 2009, 1:04am
 
JR, thank you !!!!

Yes, that was it! Putting background() in draw() erases the sctreen contineously. It's like refresh ... Now I'm enabling it only when needed Smiley

Regarding Arduino - I'm sending it instantly for every servo angle. That way it's looking better on screen Wink
Page Index Toggle Pages: 1