1

I'm Struggling to find out a way to make a pixel perfect collision shape out of a mask in pymunk.

Is there a way to do this? I've built a class in PIL that returns the mask of an image, where the transparent area is black and non-transparent area is white, but I can't find the way to make a shape out of it for a body in pymunk.

Also, which way would give better perfomance, a single concave shape or a bunch of primitives?

phyce
  • 65
  • 5
  • how about doing a Canny? or simply compute the gradient. – jgmao Sep 30 '13 at 21:16
  • Note that pymunk doesnt support concave shapes. If you have a concave shape it needs to broken up into convex shapes first. – viblo Oct 01 '13 at 10:17
  • Thanks for the canny suggestion! I'll try it right away. Also, I figured out about the concave shape today after searching for a solution, but thanks anyways. – phyce Oct 01 '13 at 18:53

0 Answers0