Developing a prototype Vision Pro app and would like to render a 3D scene made from Reality Composer Pro on an image anchor in a RealityView. But I have no luck so far to make it work and need some guidance to move on.
I got the image file stored in the assets like below:
And from below is the source codes:
import SwiftUI
import RealityKit
import RealityKitContent
struct AnchorView: View {
@State var imageEntity: Entity = {
let anchorEntity = AnchorEntity(.image(group: "AR Resources", name: "reanchor"))
return anchorEntity
}()
var body: some View {
RealityView { content in
do
{
// Add the initial RealityKit content
if let scene = try? await Entity(named: "Scene", in: realityKitContentBundle)
{
imageEntity.addChild(scene)
content.add(imageEntity)
}
}
catch
{
print("Error occurs when adding reality view content: \(error)")
}
}
}
}
Post
Replies
Boosts
Views
Activity
Hi fellows,
I am developing a conceptual prototype to explore how Apple Vision Pro can be applied in Real Estate selling. But I encounter an problem and to consult with the developer community. When rendering a massive 3D entity, sometimes it work fine but sometimes my Vision Pro device automatically reboot (all the running apps are shutdown and then Apple logo appears to reboot) while running the app.
I have a 1:1 3D entity imported into the Reality Composer Pro, and I managed to develop a simple rendering Vision Pro app.
It works great after I finally made it work and see the 1:1 building in front of me.
You can see the full demo video for details:
https://www.icloud.com/iclouddrive/0d5QA-sYSehmLF9rEMXsCUyDg#REPtt02_Demo_v1.1
But sometimes when rendering the 1:1 building, my Vision Pro device suddenly reboot. So far I have no clues on its root cause. It might be caused by the not-enough-memory or for safety concern? (since the 3D entity is big and might block a big area of the view) Can any one or even an official provide some guidance here and identify the root cause? Thx much!