How to draw multiple lines on LCD

wiccy's icon

Hi guys,

I want to use mouse draw multiple lines with a single stroke. Similar to the tool they use to draw sand patterns on a Zen Garden, as shown in the image.

I am not sure whether it is possible to achieve similar effect on LCD object, in which I hope to draw 4 lines together with certain gap between each other. I can add additional lines by offsetting (+ or -) the mouse position however this does not anticipate the angle of the drawing. Is there another way to achieve this effect?

Regards,

J

Roman Thilenius's icon

you´d have to calculate the angle all by yourself. i am just not sure offhand if it will be enough to interpolatre the results .. at a sharp corner one might need to create the turnaround artificially by rotation.

Floating Point's icon

this is a starting point: convert to polar coords, remap, convert back:

Max Patch
Copy patch and select New From Clipboard in Max.

wiccy's icon

cartopol is a very good idea. Keeping the phase the same and only offset the amplitude.

Floating Point's icon

here's a better version, basically it gets the angle the mouse is traveling in (broom handle), rotates 90 degrees (broom), then creates offsets (r1, r2 etc) along that orthogonal axis, converts back to cartesian and adds these new coordinates to the original mouse position. needs a lot of smoothing for some reason (mouse jitter I guess)

Max Patch
Copy patch and select New From Clipboard in Max.