3Dモデルを表示する SceneKit #1

Scene Kitを使って3Dモデル(.dae)を表示してみました。

Scene kit

“Scene Kit is a high-level API on top of OpenGL that operates on a scene graph”

DAE

Digital Asset Exchange Documents - XML based - Supported by the major 3D tools - Popular in the industry

Code


  NSURL *url = [[NSBundle mainBundle] URLForResource:@"lego"
                                       withExtension:@"dae"];

  NSError *error;
  SCNScene *scene = [SCNScene sceneWithURL:url options:nil error:&error];

  SCNView *view = [[SCNView alloc] initWithFrame:self.window.frame options:nil];
  view.scene = scene;
  self.window.contentView = view;

Xcode上で編集もできるようです

Finder&Previewで見れます