简体   繁体   English

如何在 Unity 中的 SkinnedMesh 对象上制作 3D 边界框?

[英]How do I make a 3D bounding box on a SkinnedMesh object in Unity?

I need to make a 3D bounding box around a SkinnedMesh renderer object for Unity.我需要在 Unity 的 SkinnedMesh 渲染器对象周围制作一个 3D 边界框。 I need to print the vertices to the screen or a JSON file for export.我需要将顶点打印到屏幕或 JSON 文件以进行导出。 Would you happen to know the key steps or even offer a code snippet for the bounding box part.您是否会碰巧知道关键步骤,或者甚至提供边界框部分的代码片段。 I can figure out how to get the data out of the engine.我可以弄清楚如何从引擎中获取数据。

Thanks for the help!谢谢您的帮助!

Brian布赖恩

I've looked around the documentation and found out that the SkinnedMeshRenderer class already has the bounds property, meaning that you probably only need to access it without having to create it.我查看了 文档,发现SkinnedMeshRenderer类已经具有 bounds 属性,这意味着您可能只需要访问它而无需创建它。

Also in theMesh.bounds and Renderer.Bounds documentations, there are a couple of snippets I belive could be helpful.同样在Mesh.boundsRenderer.Bounds文档中,我相信有几个片段可能会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM