【发布时间】:2020-01-20 20:55:27
【问题描述】:
我一直在尝试找到一种将 UIView 显示为我的 ARView 中的 3d 对象的方法。我一直在尝试创建一种可以用作显示以包含 UIView 但没有运气的盒子。
This answer 为 SceneKit 提供了解决方案,但在 RealityKit 中似乎不起作用。 到目前为止,我的想法如下,但找不到真正连接 UIView 的方法。
let box = MeshResource.generateBox(width: 0.6, height: 0.3, depth: 0.02, cornerRadius: 0.03)
let material = SimpleMaterial()
material.baseColor = --SET UIVIEW AS DIFFUSE OF MATERIAL?--
let entity = ModelEntity(mesh: box, materials: [material])
anchorEntity.addChild(entity)
【问题讨论】:
标签: swift view uiview augmented-reality realitykit