ios – Scene loaded from .rcproject file would not present up in .nonAR mode on actual iPhone system

[ad_1]

I’m attempting to create a 3D scene for an iOS app utilizing an rcproject file output from RealityComposer.

I attempted to show a Scene loaded from a .rcproject file in ARView with .nonAR mode. The code is as follows.
I’ve confirmed that the simulators show the scene correctly.

However scene just isn’t displayed on my precise iPhone8 and iPhone12 mini (Each iOS 16.03).

I’m puzzled why scene loaded from .rcproject file doesn’t present up with my precise system. If anybody has had the same expertise or has an concept of the trigger, I might respect it when you might assist me.

Thanks for taking the time to learn this put up.

struct ARViewContainer: UIViewRepresentable {

func makeUIView(context: Context) -> ARView {
 
    //  if cameramode is ".ar", work correctly
    let arview = ARView(body: .zero, cameraMode: .nonAR)

    Pattern.loadMySceneAsync { (outcome) in

        do {

            let myScene = attempt outcome.get()

            arview.scene.anchors.append(myScene)

        } catch {

            print("Didn't load myScene")

        }

    }
    
    let digital camera = PerspectiveCamera()

    let cameraAnchor = AnchorEntity(world: [0, 0.2, 0.5])

    cameraAnchor.addChild(digital camera)

    arView.scene.addAnchor(cameraAnchor)

    return arview
}


func updateUIView(_ uiView: ARView, context: Context) {}
}

[ad_2]

Leave a Reply