Hi @HunterHarris that's what I have
import SwiftUI
import RealityKit
struct ContentView: View {
var body: some View {
VStack {
Model3D(named: "filename") { model in
model
} placeholder: {
ProgressView()
}
.frame(height: 500) // Adjust this frame as needed
.padding(.bottom, 50)
Text("Hello, world!")
}
.padding()
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Post
Replies
Boosts
Views
Activity
Thank you @sadaotokuyama tokuyama-san. I will give this a try. Hey I was raised in Japan by the way. またね!
@sadaotokuyama I tried your code but all I'm getting is a spinning wheel against an opaque background in the midst of the "Content View" window.
import RealityKit
struct ContentView: View {
var body: some View {
Model3D(named: "room") { model in
model
.resizable()
.aspectRatio(contentMode:.fit)
.frame(width: 380)
} placeholder: {
ProgressView()
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}