[reactive] crayon - a 2D opengl curve renderer, with Reactive animations

Peter Verswyvelen bugfact at gmail.com
Thu Mar 26 11:00:23 EDT 2009


On Thu, Mar 26, 2009 at 3:39 PM, Jules Bean <jules at jellybean.co.uk> wrote:

> Peter Verswyvelen wrote:
>
>> Excellent work! I have been looking into curve rendering myself lately,
>> and found some links that you might find interesting (besides the Loop/Blinn
>> article Bob already forwarded to you)
>>
> Hey! I showed that article to Bob, not the other way around. Mind you, he
> was already aware of the technique, of course.
>
Oh, I also told Bob about that article, which is published in GPU GEMS 3. I
must have misunderstood. It is of course a very famous article ( but the
technique is patented :| )


> Maxim Shemanarev, the author of the open source anti-grain 2D rendering
>> engine, seems to have tackled the curve stroking (dealing with cusps etc)
>> pragmatically: <http://www.antigrain.com/mcseem/index.html>
>>  <http://www.antigrain.com/mcseem/index.html>
>>
>> http://www.antigrain.com/research/adaptive_bezier/index.html#PAGE_ADAPTIVE_BEZIER
>>
>
> That looks very interesting.


Yes, I think  what Maxim accomplished is insane.

I also came across a kind of curve that I didn't know about yet, named
>> "Pythagorean hodograph curves <
>> http://www.research.ibm.com/journal/rd/345/ibmrd3405J.pdf> ". These are
>> subsets of Bezier polynomials for which arclength is expressible as a
>> polynomial, and for which offset curves (aka parallel curves) are rational
>> polynomials again (for regular curves arclength and offsets must be
>> approximated numerically). Offset curves could be used to avoid generating
>> all those line segments to stroke a curve, even rendering them directly on
>> the GPU, but I haven't found a fast way for doing this. There's even a full
>> book about PH curves from his inventor:
>> http://www.amazon.com/Pythagorean-Hodograph-Curves-Geometry-Inseparable-Computing/dp/3540733973
>>
>> Personally I'm trying to do stroking by approximating cubic Bezier curves
>> and their offset curves with simple quadratic polynomial curves, performing
>> Delaunay triangulation, converting the quadratic curve segments to implicit
>> form, and directly rendering the triangles that form the control points of
>> the quadratics on the GPU. This is more for fun since it is most likely more
>> computationally expensive than just doing very fine subdivision and
>> rendering stroked line segments (although the implicits on the GPU is fully
>> resolution independent of course)
>>
>
> I'm concerned about the cost of repeated triangulation; I'm trying to find
> an algorithm fast enough for realtime animation (where the control points
> may move every frame). Mind you some kind of repeated calculation can't be
> avoided - it's interesting to consider algorithms which can reduce the work
> for 'small perturbation' (e.g. where the topology hasn't changed) but it's
> not obvious how to make that efficient.
>
> Loop-Blinn is obvious a good way to go for a fixed vector input (e.g. a
> font) which can be preprocessed.


Yep indeed. Only solves halve of the "animated stroked curves" problem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/reactive/attachments/20090326/b072442d/attachment.htm


More information about the Reactive mailing list