hushaojie04 / libgdx

Automatically exported from code.google.com/p/libgdx
0 stars 0 forks source link

Pixmap polygon and fillPollygon support (or fill(x, y)) #467

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Could we get an implementation of Pixmap.polygon(...) and/or 
Pixmap.fillPolygon(...). Alternatively I could just use Pixmap.fil(int x, int 
y) and draw the polygon with Pixmap.drawLine().

I could implement this myself, but I really don't feel like checking out the 
source and deviating from the trunk. Especially considering how often the 
source is updated.

Is there a reason this can't/shouldn't be implemented?

Ultimately, my goal is to draw a series of filled polygons and apply some 
blurring. If you have another suggestion (including other cross platform image 
processing libraries) I would be happy to hear it.

Thanks.

Original issue reported on code.google.com by kensuke...@gmail.com on 17 Sep 2011 at 2:57

GoogleCodeExporter commented 9 years ago
I'm afraid we currently do not plan on expanding the 2D library. Two options:

- you could check out the source and deviate from the trunk, then sending us 
your deviation in form of a patch :D
- you could implement the fill in Java using the Pixmap class. Might be slow 
depending on your use case.

I'm not aware of any small and self-contained crossplatform 2D libraries. If 
there was one we'd not have written our crappy excuse for a 2D library :/

Sorry, won't fix.

Original comment by badlogicgames on 25 Sep 2011 at 5:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
You can implement the algoritithm like this:
 - define Polygon p (found in standard java) as  Point2D
 - fillPoligon(Polygon p) should contain EarClippingTriangulator(we have it in libgdx) algorithm to get all triangles from the Polygon.  
 - because we don't have the method fillTriangle as Pixmap method, we can use fillRectangle(p1, p2, p3, p3) with the same last points. 
As a plus fillTriangle is not so hardet to implement here.

Sorry for these suggestions :)

Original comment by dunatv@gmail.com on 15 Oct 2012 at 7:18

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Can we have at least fillTriangle implementation ?

Original comment by dunatv@gmail.com on 16 Oct 2012 at 2:28

GoogleCodeExporter commented 9 years ago
We welcome contributions. I'm afraid we have no plans implementing this at this 
point. Also, please stop spamming the tracker.

Original comment by badlogicgames on 16 Oct 2012 at 3:31

GoogleCodeExporter commented 9 years ago
fillTriangle is a must in my opinion

Original comment by crinela....@gmail.com on 26 Oct 2012 at 10:08

GoogleCodeExporter commented 9 years ago
Cool, then implement it.

Original comment by quantumg...@gmail.com on 26 Oct 2012 at 10:47