Help needed with jit.gl.sketch and layers

Jul 27, 2011 at 9:15pm

Help needed with jit.gl.sketch and layers

Hi!

Im new to Jitter. Read sa much from the forum as possible, but I could use a little advise on this one.

I am making a drawing patch for an installation. Im using stroke in jit.gl.sktech, modified from the forum.

But the new lines that are drawn are below the old lines. I tried to solve this with layers, but that doesn’t seem to work within one jit.gl.sketch object (sending multiple stroke command with different layer numbers does nothing).

Turns out the layer only work if I use seperate sketch objects. But since I want to use the layers as an undo system (deleting the layer), it’s not so handy to have X number of sketch objects for each layer.
Generating objects of the fly is also something I dont know how to do so…

What would be the best approach for this?

here is my patch I simplified a bit for this example, sorry if it is a bit messy. Still a beginner :)

– Pasted Max Patch, click to expand. –

thanks in advance

#58216
Jul 27, 2011 at 10:12pm

hi.. for the overlaping issue you just need to turn off the depth_enable of the gl.sketch.

good luck with the project!

#209080
Jul 28, 2011 at 5:29pm

hey thanks! that did the trick indeed!

too bad the layers don’t work in jit.gl.sketch

Im thinking now to make my undo system with the mouse positions that are recorder each time there is a mouse down and then redraw everything minus one when ‘undo’ is pressed.
I hope that performs fast enough…

Or is there a way to erase a specific stroke? Im also wondering that in relation to building something like a eraser but that’s maybe not possible with vector based drawing like this.

Thanks,
Maarten

#209081

You must be logged in to reply to this topic.