Forums > Jitter

lineto (non-jaggy) alternative with jit.lcd?

December 3, 2011 | 9:58 pm

Basically what I’m trying to do is allow people to write with a wacom tablet and dynamically record videos of them doing so, but I want it to resemble (as closely as possible) actual handwriting. Drawing (using default lineto) with jit.lcd (especially when the size of the lcd is increased) is jaggy as all get out. So I managed to enable drawing using paintoval but the difficulty now is creating continuous "lines". You’ll notice if you move the mouse quickly it leaves big gaps – no good. I encountered the same problem with a simple processing sketch. Maybe I am going about this completely wrong, not sure.

Thanks!

– Pasted Max Patch, click to expand. –

December 5, 2011 | 12:21 pm

hi..
in the past i was doing something similar and i found the best solution with jit.gl.sketch and the stroke* commands..

theres many examples in the forum try searching for strokepoint or strokeparam

best!


December 5, 2011 | 10:22 pm

Hi carsol,

Thank you for the reply, using jit.gl.sketch with the stroke attributes seems like it may be the solution. I came across an example in Jitter Recipes: Book 2:

http://cycling74.com/2006/02/14/jitter-recipes-book-2/ (Recipe 17 – TwineBall)

but am unclear on a number of things (and apologies I’m a beginner):

1. Do the beginstroke, strokepoint and endstroke messages all need to be sent (and in this order) to draw a stoke/curve?
2. I understand that strokepoint is merely "an anchor point", so when where do I actually define the stroke/curve?
3. What is strokeparam order?

Also if you (or anyone) knows of (or would be willing to make) an easier example I would greatly appreciate it, this one’s a bit complex for just trying to understand the basics of the object and attributes (imho).


December 5, 2011 | 10:44 pm

also take a look at the jit.gl.path object (max 6 only)
might be slightly easier for you to implement than the gl.sketch stroke commands.

if you’re adding lots of points, make sure you set the @segments attribute as small as possible (the more points in the path you provide, the fewer segments you’ll need between those points to make the path look smooth).


December 6, 2011 | 6:48 pm

I would also consider looking at jit.mgraphics as an alternative to jit.lcd.

It’s a little more complicated to use, but Darwin has a great JS based introduction to MGraphics as used from Javascript. Much of the same logic applies to jit.mgraphics used either in a patcher or in JS. You can also just use the ordinary JS MGraphics implementation and copy the final output to a matrix. Darwin’s tutorials show this as well.

http://cycling74.com/2011/11/11/november-patch-a-day/


January 23, 2012 | 12:53 pm

exploring ways to create my modular framework to easily generate video based on JS (http://cycling74.com/forums/topic.php?id=37690 ), reading here & there advices… I guess I now HAVE TO use JSUI/MGraphics implementation and popout matrix to jit.window even if the JSUI part itself wouldn’t be used as UI element…

I mean, it seems the best/easy way to do what I want to do instead of jit.lcd or eventually JS manipulating jitter objects…


Viewing 6 posts - 1 through 6 (of 6 total)