微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么SCNView无法在iPhone XS Max上运行?

如何解决为什么SCNView无法在iPhone XS Max上运行?

我有一个以编程方式创建的场景。它可以正常工作,然后有一天,一个QATester报告称她的手机的SceneView无法正常工作(显然,她的手机的代码存在很多问题,疯狂的随机错误不确定iPhone XS Max上正在发生什么。)

现在我已经创建了这样的场景:

        let scene = SCNView()
        scene.frame = scvContainer.frame
        scene.autoresizingMask = [.flexibleWidth,.flexibleHeight]
        scene.backgroundColor = .clear
        vLayout = scene

        // Added to a scrollView's container 
        scvContainer.superview?.addSubview(scene)
    
    // After sometime (added the view first,then request API then wait a bit)
        scene.scene = SCNScene()
        scene.allowsCameraControl = true
        scene.antialiasingMode = .multisampling4X
        scene.preferredFramesPerSecond = 60

        // This is just for the sake of demonstrating the problem
        scene.scene?.rootNode.addChildNode(SCNNode(geometry: SCNSphere(radius: 50)))

然后显示图像:

SceneView

由于我还是SceneKit的新手,所以我不知道发生了什么。 紫色视图是我希望ScnView显示球体的位置。这是在iPhone XS Max,Real Device iOS13,iPhone xs max模拟器12.4上发生的。

我认为可能是因为渲染,但是我不知道如何选择渲染器。如果不使用sceneKit和SCNView,还有哪些其他选项可用于渲染3d?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。