【问题标题】:Is there any other way to display UIView into ARKit?有没有其他方法可以将 UIView 显示到 ARKit 中?
【发布时间】:2018-01-21 02:28:05
【问题描述】:

下面是我的代码和相机图像,用于将 2d UIView 加载到 sceneView 中。我已经尝试加载到材料内容中,但让节点多次空白。

let annotationNode = SCNNode()      
let planeGeoMetry:SCNPlane = SCNPlane()
planeGeoMetry.firstMaterial?.fillMode = .fill

planeGeoMetry.firstMaterial?.diffuse.contents = view
annotationNode.name = name
annotationNode.geometry = planeGeoMetry   
self.sceneView.scene.rootNode.addChildNode(annotationNode)

【问题讨论】:

    标签: ios swift scenekit metal arkit


    【解决方案1】:

    来自SCNMaterialProperty.contents 上的 Apple 文档:

    SceneKit 不能使用已经在别处显示的图层(例如, 界面视图 对象)

    就个人而言,在飞机上显示信息的最简单方法是使用SpriteKit Scene

    【讨论】:

      猜你喜欢
      • 2021-08-03
      • 1970-01-01
      • 1970-01-01
      • 2020-02-22
      • 1970-01-01
      • 1970-01-01
      • 2020-05-11
      • 1970-01-01
      相关资源
      最近更新 更多