如何解析图像的边界顶点?复杂物体几何形状(先知物理学)
如何通过扫描图像并检测其形状(其不透明像素)来创建身体顶点?
我想创建复杂的几何形状,但实际上我不知道从哪里开始,所以任何建议将不胜感激。接受的答案很可能是解释最重要的想法的答案。
提前致谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
FarseerPhysics 具有将纹理转换为多边形(向下滚动到纹理到多边形)的功能,适合用来创建实体。
我想这就是你要找的?
但请注意,纹理到多边形转换的本质本质上是一件危险且复杂的事情,如果您的图像不是原始状态(即它有很多半不透明像素和基于不透明度的模糊),您会得到意想不到的结果结果。
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.