Can SpriteBatch be used to fill a polygon with a texture?

Posted by can poyrazoglu on Game Development See other posts from Game Development or by can poyrazoglu
Published on 2011-09-25T20:47:14Z Indexed on 2011/11/25 18:05 UTC
Read the original article Hit count: 329

Filed under:
|
|

I basically need to fill a texture into a polygon using the SpriteBatch. I've done some research but couldn't find anything useful except polygon triangulation method, which works well only with convex polygons (without diving into super math which is definitely not something I'm pretty good at). Are there any solutions for filling in a polygon in a basic way? I of course need something dynamic (I'll have a map editor that you can define polygons, and the game will render them (and collision detection will also use them but that's off topic), basically I can't accept solutions like "pre-calculated" bitmaps or anything like that. I need to draw a polygon with the segments provided, to the screen, using the SpriteBatch.

© Game Development or respective owner

Related posts about XNA

Related posts about polygon