https://github.com/sakrist/gltfscenekit
GLTF extension for SceneKit
https://github.com/sakrist/gltfscenekit
apple gltf2 scenekit swift swift-package-manager
Last synced: about 1 month ago
JSON representation
GLTF extension for SceneKit
- Host: GitHub
- URL: https://github.com/sakrist/gltfscenekit
- Owner: sakrist
- License: mit
- Created: 2017-11-12T19:41:27.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2019-12-27T23:14:26.000Z (over 5 years ago)
- Last Synced: 2025-03-18T07:02:35.969Z (about 2 months ago)
- Topics: apple, gltf2, scenekit, swift, swift-package-manager
- Language: Swift
- Homepage:
- Size: 341 KB
- Stars: 52
- Watchers: 7
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GLTF extension for SceneKit
#### General
- [X] Compilable for macOS and iOS
- [X] Objective-C support
- [X] swift package
- [ ] GLTF swift extension with wrapper for JSONDecoder
- [ ] Tests
- [ ] Convert SceneKit to GLTF
#### Encodings
- [X] JSON
- [ ] Binary (.glb)
#### Primitive Types
- [ ] Points
- [x] Lines
- [ ] Line Loop
- [ ] Line Strip
- [x] Triangles
- [x] Triangle Strip
- [ ] Triangle Fan#### Animation
- [X] Transform animations
- [X] Linear interpolation
- [X] Morph animation
- [ ] Skin and joint animation#### Extensions
- [ ] KHR_draco_mesh_compression - Draco (supported draft version, need rework. temporary disabled)
- [X] 3D4M_compressed_texture - [Draft of unofficial extension.](https://github.com/sakrist/glTF/tree/extensions/compressed_texture/extensions/2.0/Vendor/3D4M_compressed_texture)
Example:
```swift
import glTFSceneKitlet 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.
}
}
```