We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am working on an drawing mobile app with which you can scribble graffiti , now I encounter a problem, how to make the brush stroke change based on the speed I draw,that means when I draw very fast, the line can be thin, and vice verse, it would be thick when drawing slowly,I used the processing to program, i thought about some ideas about how to solve this problem, but unluckily most of them turned out to be not correct and can not reach my requirement, I am here searching for some good solutions that can help me deal with the problem, appreciate for any suggestions.if you have any good suggestions or similar experience you can also send email to me, my email address is jinshanliu08@gmail.com. Thanks again.
Answers
(duplicate. see other thread)
if(mousePressed ) { distance=((pmouseX-mouseX))+((pmouseY-mouseY)); if(distance!=0)ellipse(mouseX,mouseY,10/distance,10/distance); //line(mouseX, mouseY, pmouseX, pmouseY);
stroke(#AEC4C6); strokeWeight(7);
I also use line(mouseX,mouseY, pmouseX, pmouseY); but I do not know with this, how the change the thickness of the brush stroke based on the speed that you paint
and for the former one, although it can change the thickness,but it is not smooth and continuous when user draw quickly, it turns out to be a list of ellipse.
so finally my purpose is that I want to make the stroke change based on the speed that i draw with smooth and continuous line.
Thanks man,that works well,I would like to show you the app i will create after finish
Hi chrisir, the last question for the final brush stroke the last brush that I want to create is one with water droplets,that means after I draw the line, there comes out a short line slowly from the line that I drew, it is random,but when I draw fast, the droplets are little, otherwise when I draw slowly, the droplets are much more. as it seems that the picture can not be viewed so I hope you can understand me.
yes
show your attempt
here is a small example with ideas from the forum - not by me...
this basically draws small explosions (of colorful and growing lines) along the mouse path
The speed of the mouse movement is again used to determine the number or length of the lines
that is cool, I will try that I tried the code you posted and there is a little problem, which is the line is not smooth even it is continuous, like it is a jointed line, as it is a painting brush stroke, i want to make it as real as possible.so I wonder if there is any other methods to make it smooth.
I wonder that too
when you wrote
you were referring to the sketch with
strokeWeight
I guess.Here comes a improved version which uses damping when it comes to changing the strokeWeight
The damping value is .0178, meaning 0.0178, the smaller this number, the slower the strokeWeight changes (it can get still very high but slowly so). Because strokeWeight changes slower I hope it looks more smooth.
hope this helps.
Chrisir
wow,this is amazing,that is much better now, I think it can be the final version then. Thank so much, now i have create 6 brush strokes for my project. I would like to show you later.
Please do so
Can I have your email so that you can have a look at the brush that I created.
here a color selector from the forum (not by me!!!)
from
https://forum.processing.org/two/discussion/13739/make-this-code-to-kinect-color-picker