Skip to content

Instantly share code, notes, and snippets.

@czwen
Created March 5, 2018 11:14
Show Gist options
  • Save czwen/a2ce89725ef6b58e6c24f90799eb581a to your computer and use it in GitHub Desktop.
Save czwen/a2ce89725ef6b58e6c24f90799eb581a to your computer and use it in GitHub Desktop.
- (SCNNode*)nodeFromDaeAtPath:(NSString*)path withIdentifier:(NSString*)identifier {
NSURL *urlToColladaFile = [[NSBundle mainBundle] URLForResource:path withExtension:@"dae"]; // Create NSURL from input path
SCNSceneSource *sceneSource = [[SCNSceneSource alloc] initWithURL:urlToColladaFile options:nil]; // Create a temporary SCNScene
SCNNode *node = [sceneSource entryWithIdentifier:identifier withClass:[SCNNode class]]; // Create a node from the model represented by the identifier
return node;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment