Thank you so much for this information!
Post
Replies
Boosts
Views
Activity
I actually solved my own problem. Export to USDZ is not enabled by default. To enable it, go to Settings -> Reality Composer -> Toggle on Enable USDZ Export.
One option is to export to .reality, upload that to cloud storage and pull it in Swift Playgrounds. I've made a video to do exactly that: https://youtu.be/37o_Yt-wEJE Hope it helps!
There currently isn't as simple way to do so (at least in ARKit 3.5). You can access the vertices and faces using ARMeshGeometry but that's raw data stored in a MTLBuffer. Let's hope ARKit 4.0 will provide more accessibility to raw data.
Were you ever able to get nonAR mode working? I created the following in Swift Playgrounds but no luck (view is black).import PlaygroundSupport
import RealityKit
let arView = ARView(frame: .zero, cameraMode: .nonAR, automaticallyConfigureSession: true)
let light = PointLight()
light.light.intensity = 10000
let lightAnchor = AnchorEntity(world: [0,0,0])
lightAnchor.addChild(light)
arView.scene.addAnchor(lightAnchor)
let plane = MeshResource.generatePlane(width: 10, depth: 10)
let material = SimpleMaterial(color: .white, roughness: 0.5, isMetallic: true)
let planeEntity = ModelEntity(mesh: plane, materials: [material])
let planeAnchor = AnchorEntity(world: [0,0,0])
planeAnchor.addChild(planeEntity)
arView.scene.addAnchor(planeAnchor)
PlaygroundPage.current.setLiveView(arView)
Thanks for the prompt reply. I feared the answer was no (given there isn't full parity on other UIKit vs SwiftUI components).
For now I will use a UIViewRepresentable and Coordinator to bring UITextView into SwiftUI.