Here is some code:
http://code.google.com/p/rugl/source/browse/trunk/droid/DroidRUGL/src/com/ryanm/droid/rugl/util/geom/Tesselator.java
that will take a list of x,y vertex coordinates of a simple polygon
(concave is fine, self-intersecting is not) and spit out the vertex
and triangle index arrays suitable to be sent to opengl (in
GL_TRIANGLES format)

It should be pretty easy to pull out, there's only a few small utility
methods that it relies on. Failing that, the algorithm is pretty
simple and well-commented.

OpenGL is easier than you think, don't let it intimidate you!

Ryan

On Jan 20, 2:58 am, Brill Pappin <[email protected]> wrote:
> That explains a lot about why things didn't make sense to me... I kept trying 
> to tell it to simply draw points and connect them!
>
> It's actually those vertices that are giving me trouble... they are just not 
> friendly to an Application programmer :)
>
> - Brill Pappin
>
> On 2011-01-19, at 8:24 PM, Indicator Veritatis wrote:
>
>
>
>
>
>
>
> > OpenGL ES, the standard not just for Android but for all mobile phones
> > to date, only supports drawing triangles, not polygons. To get a
> > polygon, you have to triangulate it first, then pass an array of
> > vertices based on that triangulation.
>
> > Triangulation turns out to be a subtle combinatorial problem.
>
> > On Jan 17, 11:59 am, Brill Pappin <[email protected]> wrote:
> >> Thanks Robert. I'll take that advice.
>
> >> In particular what we want are some extensions to the framework(s) that 
> >> make
> >> supporting segmented maps easier for us to work with. Most frameworks have

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to