Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/magicien/gltfscenekit
glTF loader for SceneKit
https://github.com/magicien/gltfscenekit
gltf gltf-loader scenekit scenekit-framework swift
Last synced: 2 days 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 (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-20T06:13:05.000Z (9 months ago)
- Last Synced: 2024-10-28T12:54:43.212Z (17 days ago)
- Topics: gltf, gltf-loader, scenekit, scenekit-framework, swift
- Language: Swift
- Size: 5.05 MB
- Stars: 290
- Watchers: 15
- Forks: 91
- Open Issues: 41
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
# GLTFSceneKit
glTF loader for SceneKit![ScreenShot](https://raw.githubusercontent.com/magicien/GLTFSceneKit/master/screenshot.png)
## 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 GLTFSceneKitvar 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