开发者

How to parse image for border vertices? Complex object geometry (farseer physics)

How could I create body vertices by scanning image and detecting it's shape (of it's non-transparent pixels)?

I wanna create complex geometry, and I actually have no real idea where to start, so any advice would be highly appreciated. Accepted answer would most likely be the one that explains the topmost idea.

开发者_StackOverflow中文版

Thanks in advance


FarseerPhysics has functionality for converting textures into polygons (scroll down to Texture to Polygon) suitable to create bodies from.

I think that's what you're looking for?

Be warned though, the nature of texture to polygon conversions is an inherently dangerous and complex thing to carry out, if your image isn't in pristine condition (i.e. it has a lot of half opaque pixels and opacity based blurring) you will get unexpected results.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜