Skip to content

dornad/GLTFSceneKit

 
 

Repository files navigation

Carthage compatible

GLTFSceneKit

glTF loader for SceneKit

ScreenShot

Installation

Using CocoaPods

Add the following to your Podfile:

pod 'GLTFSceneKit'

Using Carthage

Add the following to your Cartfile:

github "magicien/GLTFSceneKit" ~> 0.3.0
  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 - QuickLook plugin for glTF files

About

glTF loader for SceneKit

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 88.2%
  • JavaScript 5.9%
  • GLSL 3.8%
  • ShaderLab 1.4%
  • Ruby 0.4%
  • Objective-C 0.3%