【问题标题】:Way to access Renderable submesh(es) in ARCore/Sceneform?在 ARCore/Sceneform 中访问可渲染子网格的方法?
【发布时间】:2019-11-24 12:48:27
【问题描述】:

使用 ARCore/Sceneform API,我需要访问 Renderable 的特定子网格,但找不到方法。

我想知道这个功能是否是通过 RenderableDefinition 实现的,但是文档对这个主题不是很清楚。

对此有何建议?

感谢您的宝贵时间。

【问题讨论】:

  • 如果找到方法请放在这里
  • 目前没有进展。

标签: arcore sceneform


【解决方案1】:

您可以使用 getMaterial(int subMeshIndex) 方法访问它。

ModelRenderable modelRenderable = (ModelRenderable) transformableNode.getRenderable();
modelRenderable.getMaterial(4); //4 is the submesh index

【讨论】:

  • 使用子网格名称而不是索引偏移量的任何方式?
  • 我不确定。将不得不检查。
  • 有一种方法可以从索引中获取子网格名称。所以我们可以创建一个名称的哈希图来索引并在全局范围内定义它。现在,我们可以使用 submesh 名称通过 hasmap 获取具体的 submesh。
  • 请注意,在(最后和存档版本)Sceneform 1.16.0 下,子网格大小始终返回 0(此处发布),因此无法访问特定的,
猜你喜欢
  • 2019-01-24
  • 2020-10-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-11-08
  • 1970-01-01
  • 2023-03-08
  • 1970-01-01
相关资源
最近更新 更多