This prototype links a SwiftUI interface to a 3D TV mesh using RealityView in VisionOS.
Inside RCP → Create a new scene called “TVScene”
Bring in usdz to RCP. (Increase the scale, 1 1 1)
Rename it to TVScreenModel, if needed
In swift, create a new view called “ImmersiveTVView”. If the model appears on the preview, then we have successfully located the model.
import SwiftUI
import RealityKit
import RealityKitContent
struct ImmersiveTvView: View {
var body: some View {
RealityView { content in
// Add the initial RealityKit content
if let model = try? await Entity(named: "TVScene", in: realityKitContentBundle) {
content.add(model)
model.position = SIMD3(x: 0, y: 1.3, z: -1.0)
content.add(model)
}
}
}
}
#Preview(immersionStyle: .mixed) {
ImmersiveTvView()
}