Open YogeshSDM opened 2 years ago
import UIKit
import SceneKit
import UIKit
import GLTFSceneKit
class YZGltViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let scnView = SCNView()
var scene: SCNScene
do {
let sceneSource = try GLTFSceneSource(named: "cylinderEngine.glb")
scene = try sceneSource.scene()
scnView.scene = scene
scnView.frame = view.bounds
scnView.allowsCameraControl = true
scnView.autoenablesDefaultLighting = true
view.addSubview(scnView)
} catch {
print("\(error.localizedDescription)")
return
}
}
}
I just run sample code and getting empty blank screen. path for .glb is correct. But still getting blank screen. See attachment.
I would be appreciated if you help me out