Quantcast
Channel: Arduino - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 747

Trying to simulate Paint app in processing, question about drawing effect

$
0
0

Hi guys, im trying to accomplish something in my code and i dont even have an idea how to do it, so ill try to explain it best as i can: I wanna be able to draw in processing, basically what i wanna do is something like a paint app we all have on Win OS, when i move mouse around (and when it is pressed for example. but doesnt have to be) i want it to make a drawing effect on background, now i already accomplished that but, but what i also want is when mouse moves away too fast, from one point to another (if its a mistake by human hand), in that case i dont want it to draw anything on board, but only when i move it relatively slowly,and also when i move it fast like that from point A to point B i just want that circle (ellipse) to show at the point B,again, dont want it to leave trace in between those points To make drawing effect im using PGraphics, and it looks something like this:

  x = constrain(x, 0 + radius/2, width - radius/2);
  y = constrain(y, 0 + radius/2, height - radius/2);


  paint.beginDraw();
  paint.fill(R, G, B);
  paint.noStroke();
  paint.ellipse(x, y, radius, radius);
  paint.endDraw();

that ellipse is the pointer which is making drawing effect on some background, x and y are mouse coordinates


Viewing all articles
Browse latest Browse all 747

Latest Images

Trending Articles



Latest Images