3

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.

Thanks in advance

Johnny
  • 889
  • 2
  • 13
  • 24
  • Are these tags correct? I mean, of the four I'm familiar with only one, physics, and this doesn't sound like a physics problem. Wouldn't "geometry" and "image processing" be better? – Beta Feb 09 '10 at 20:47
  • You are right, I'll change the tags. However I've found a solution, and I'll post it as soon as I verify it. – Johnny Feb 09 '10 at 21:16

1 Answers1

1

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.

meds
  • 21,699
  • 37
  • 163
  • 314
  • I've been working on this long time ago, and finally made a solution that I can't find anywhere on my HDD to upload as a complete answer. Too bad I was too lazy for it back then, thanks anyways, hopefully you've helped someone else as well. – Johnny Jul 03 '11 at 01:24