diagonal lines with jit.gl.sketch

johannes-eckart@gmx.at's icon

Hi community,
I have created a little patch to draw some lines in a jit.window. I am using [jit.gl.sketch] with the command [lineto $1 $2].
The problem is:
If I use [pack] to get the x- and y-coordinates to [jit.gl.sketch], I can draw also diagonal lines. But a vertical line (Y) is not possible because of the right inlet to [pack]! I would have to change also X, but so Inever get a clear vertical line.
If I use [pak] I can draw also a proper vertical line (Y), but for a diagonal line I just get some kind of "zig-zag"...
Could anybody has a look on this patch to solve this problem?

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

I really a litle bit stucked at that point!
Thanks a lot!
Johannes

tim_thompson@mac.com's icon

The problem is that for the diagonal you need the list sent every time with the same value for x and y, and you don't get that with pak. The problem is exaggerated when the control is moved more quickly, depending on the render rate. In the end, you need to use both pack (for diagonal) and pak (for Y only).

Here are some adjustments that help a little.

Tim

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

johannes-eckart@gmx.at's icon

Hi Tim!
They really helped me!! Thank you very much! I get the lines I want now.
Greetings,
Johannes

yacine's icon

bondo is your freind

//yac

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

johannes-eckart@gmx.at's icon

Hey there,
sorry for my late answer but wasn't connected the last weeks...
Thanks for your help Tim and Yac!!!
I am going on with my project now.
Greetings,
Johannes