Hey, I'm playing with drawing inside a sketch but those jagged lines don't look too good :) Is there a way to increase the sampling speed of the mouse so I can get nice lines?
Thanks for all the replies. I've been thinking if I can do this with bezier curves, if I calculate the vectors for the mouse-movement I might be able to make good bezier handles. I'll research more. Thanks.
Also.. I'm sorry for the late reply. I'm not getting the notifications on new replies via email.
Answers
draw will run 60 times a second by default. you can change this but it'll be limited by the hardware.
maybe you can use mouseMoved() and store the moves there, and draw them the next time draw() executes.
http://studio.ProcessingTogether.com/sp/pad/export/ro.9ldYvJUyiXGzi
See https://processing.org/examples/continuouslines.html
More, try to divide the distance between (pMouseX, pMouseY) and (mouseX, mouseY) by 10, and then draw at each of the intermediate positions.
drawing 10 co-linear lines instead of one? that'll look exactly the same.
@koogs: you right :)
My fault: i was thinking about tracing curve with more points.
Thanks for all the replies. I've been thinking if I can do this with bezier curves, if I calculate the vectors for the mouse-movement I might be able to make good bezier handles. I'll research more. Thanks.
Also.. I'm sorry for the late reply. I'm not getting the notifications on new replies via email.
This discussion might help.
thanks, @quark