Example:
import glTFSceneKit
let directory = "..." // path to folder where is gltf file located
let decoder = JSONDecoder()
let glTF = try? decoder.decode(GLTF.self, from: jsonData)
if let converter = GLTFConverter(glTF: glTF) {
let scene = converter.convert(to: view.scene!, geometryCompletionHandler: {
// Geometries are loaded and textures are may still in loading process.
}) { (error) in
// Fully converted to SceneKit
// TODO: handle error.
}
}
link |
Stars: 48 |
Last commit: 4 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics