【发布时间】:2021-08-09 13:24:13
【问题描述】:
let material = SimpleMaterial.init(color: .red,roughness: 1,isMetallic: false)
let doorBox = MeshResource.generateBox(width: 0.02,height: 1, depth: 0.5)
let doorEntity = ModelEntity(mesh: doorBox, materials: [material])
let anchor = ARAnchorEntity()
anchor.addChild(doorEntity)
在 RealityKit 中,我有一个 MeshResource 的盒子,盒子看起来像一条线。我在 ARView 中添加了这个框,并设置了实时相机位置。在一种情况下,我想知道 Box/Line 的开始和结束位置。
假设带有实体的盒子有中间/当前位置 (0.1,0.23,-1.3) 那么盒子的左右位置是什么?带框的锚点会随着相机的移动不断改变它的位置。
提前致谢。
【问题讨论】:
标签: ios swift augmented-reality arkit realitykit