magicien / GLTFSceneKit

glTF loader for SceneKit
MIT License
291 stars 91 forks source link

run sample code and getting empty blank screen #63

Open YogeshSDM opened 2 years ago

YogeshSDM commented 2 years ago

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

Screenshot 2022-05-27 at 1 17 36 PM

YogeshSDM commented 2 years ago

some gab files are not showing dd.zip dd.zip

xgkp commented 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
        }
    }
}