https://github.com/magicien/gltfscenekit
glTF loader for SceneKit
https://github.com/magicien/gltfscenekit
gltf gltf-loader scenekit scenekit-framework swift
Last synced: about 1 year ago
JSON representation
glTF loader for SceneKit
- Host: GitHub
- URL: https://github.com/magicien/gltfscenekit
- Owner: magicien
- License: mit
- Created: 2017-08-18T00:26:28.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-02-20T06:13:05.000Z (over 2 years ago)
- Last Synced: 2025-03-28T17:11:16.729Z (over 1 year ago)
- Topics: gltf, gltf-loader, scenekit, scenekit-framework, swift
- Language: Swift
- Size: 5.05 MB
- Stars: 298
- Watchers: 14
- Forks: 92
- Open Issues: 42
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/Carthage/Carthage)
# GLTFSceneKit
glTF loader for SceneKit

## Installation
### Using [CocoaPods](http://cocoapods.org/)
Add the following to your [Podfile](http://guides.cocoapods.org/using/the-podfile.html):
```rb
pod 'GLTFSceneKit'
```
### Using [Carthage](https://github.com/Carthage/Carthage)
Add the following to your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile):
```
github "magicien/GLTFSceneKit" ~> 0.4.0
```
### Using [Swift Package Manager](https://swift.org/package-manager/)
1. Open your project with Xcode
2. Select `File` > `Swift Packages` > `Add Package Dependency...`
3. Put `https://github.com/magicien/GLTFSceneKit` in the search box and click `Next`
## Usage
### Swift
```
import GLTFSceneKit
var scene: SCNScene
do {
let sceneSource = try GLTFSceneSource(named: "art.scnassets/Box/glTF/Box.gltf")
scene = try sceneSource.scene()
} catch {
print("\(error.localizedDescription)")
return
}
```
### Objective-C
```
@import GLTFSceneKit;
GLTFSceneSource *source = [[GLTFSceneSource alloc] initWithURL:url options:nil];
NSError *error;
SCNScene *scene = [source sceneWithOptions:nil error:&error];
if (error != nil) {
NSLog(@"%@", error);
return;
}
```
## See also
[GLTFQuickLook](https://github.com/magicien/GLTFQuickLook) - QuickLook plugin for glTF files