[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] Questions about trapezoids, triangle stripper etc.

From: strk
Subject: Re: [Gnash-dev] Questions about trapezoids, triangle stripper etc.
Date: Mon, 18 Sep 2006 10:24:22 +0200

Udo, good digging!
I don't have an answer for your question, so I'd just suggest you
try completely skipping the tesselator and see what happen with
some of the existing testcases.
In general, it would be nice if you could write down this info
in the gnash manual (internals chapter) for future references.

In particular, I'm trying to separate the "parser" code from 
the "playing" code and I think your digging might help me in this.
For example, is the 'line strips' creation done at parse time
or at play time ? What happen when new lines are added at runtime
(we currently don't support the drawing API so it's likely there's
no support of dynamic drawing) ?


On Wed, Sep 13, 2006 at 07:49:08PM +0200, Udo Giacomozzi wrote:
> Hi again.
> Ok, things are getting clearer now. I studied everything and came now
> to the tesselator part.
> AFAIK, curves and lines are loaded into a list of "edges" which then
> are either passed as "line strips" to the renderer (in the case of an
> outline) or mangled through the tesselator if it is a filled shape.
>   BTW, straight lines seem to be converted to curves where the control
>   point equals the new anchor point (resulting a straight line on
>   screen). That explains why simple straight lines are drawn in pieces
>   of different length. This could be optimized, I'd say...
> Back to my question:
> The outline mesh is passed to the "tesselator", which seems to
> generate a list of trapezoids that together form the correct
> fill for the shape, correct? These trapezoids have parallel upper and
> lower sides, and probably they perfectly horizontal on the screen.
> Ok, these trapezoids are then split to two triangles via the
> "tri_stripper". I guess this is to support accelerated hardware?
> Anyway, in the end we probably have a bunch of triangles that form the
> shape (and are passed to the backend).
> Now, we would like to bypass the tesselator completely and let the
> backend draw the original shape itself (based on straight lines is
> ok). The reason is that these triangles (the shape) look awful when
> rendered through AGG. This may be because of the anti-aliasing or
> because AGG does some intersection computing. Anyway, one can clearly
> recognize those triangles when a simple rectangle should be displayed.
> Anyway, I'd like to learn more about the tesselator because it's the
> missing piece in my Gnash puzzle.
> I hope someone can answer any of these questions:
> - What's the true story behind the tesselator and the trapezoids? I
>   admit I don't know anything about filling algorithms theory.
> - Are the triangles really just two pieces of the trapezoids? I ask
>   because the "tri_stripper" is implemented rather complicated for
>   such a simple task. Apparently the order of the triangles follow
>   some logic?
> - What do the arguments passed to add_trapezoid() exactly mean?
> - Is all this tesselator/trapezoid/triangle stuff used *only* for
>   rendering or has it an additional uses, for example collision
>   detection? With other words: Would it be safe to disable it
>   altogether?
> Looking forward for any hint,
> Udo
> _______________________________________________
> Gnash-dev mailing list
> address@hidden


 /"\    ASCII Ribbon Campaign
 \ /    Respect for low technology.
  X     Keep e-mail messages readable by any computer system.
 / \    Keep it ASCII. 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]