Swiftpack.co - magicien/GLTFSceneKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by magicien.
magicien/GLTFSceneKit vrm-v0.0.14
glTF loader for SceneKit
⭐️ 280
🕓 2 years ago
iOS macOS
.package(url: "https://github.com/magicien/GLTFSceneKit.git", from: "vrm-v0.0.14")

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.4.0

Using Swift 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 - QuickLook plugin for glTF files

GitHub

link
Stars: 280
Last commit: 5 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Related Packages

Release Notes

0.4.0
1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/magicien/GLTFSceneKit/compare/v0.1.3...0.4.0

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics