ARKit

#import "ViewController.h"@interface ViewController ()@property (nonatomic, strong) IBOutlet ARSCNView *sceneView;@end    @implementation ViewController- (void)viewDidLoad {    [super viewDidLoad];    // Set the view's delegate    self.sceneView.delegate = self;        // Show statistics such as fps and timing information    self.sceneView.showsStatistics = YES;        // Create a new scene    SCNScene *scene = [SCNScene sceneNamed:@"art.scnassets/ship.scn"];        // Set the scene to the view    self.sceneView.scene = scene;}- (void)viewWillAppear:(BOOL)animated {    [super viewWillAppear:animated];        // Create a session configuration    ARWorldTrackingSessionConfiguration *configuration = [ARWorldTrackingSessionConfiguration new];        // Run the view's session    [self.sceneView.session runWithConfiguration:configuration];}- (void)viewWillDisappear:(BOOL)animated {    [super viewWillDisappear:animated];        // Pause the view's session    [self.sceneView.session pause];}- (void)didReceiveMemoryWarning {    [super didReceiveMemoryWarning];    // Release any cached data, images, etc that aren't in use.}#pragma mark - ARSCNViewDelegate/*// Override to create and configure nodes for anchors added to the view's session.- (SCNNode *)renderer:(id)renderer nodeForAnchor:(ARAnchor *)anchor {

SCNNode *node = [SCNNode new];

// Add geometry to the node...

return node;

}

*/

- (void)session:(ARSession *)session didFailWithError:(NSError *)error {

// Present an error message to the user

}

- (void)sessionWasInterrupted:(ARSession *)session {

// Inform the user that the session has been interrupted, for example, by presenting an overlay

}

- (void)sessionInterruptionEnded:(ARSession *)session {

// Reset tracking and/or remove existing anchors if consistent tracking is required

}

@end

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • ARKit从入门到精通(1)-ARKit初体验标签: ARKit2017-06-12 17:33 1772人阅读 ...
    零度_不结冰阅读 899评论 0 2
  • ARkit Introducing ARKit iOS 11引入ARKit,这是 个全新的框架,允许开发者轻松地为...
    坤哥爱卿阅读 1,437评论 0 1
  • 转载请标注出处:http://blog.csdn.net/u013263917/article/details/7...
    Jonath阅读 494评论 0 1
  • 此文章为转载文章 ARKit从入门到精通(1)-ARKit初体验 1.1-AR技术简介 增强现实技术(Augmen...
    泥孩儿0107阅读 641评论 0 1
  • 亲爱的干爹: 你还好吗?不见您已经有三个月时间,分外想念的同时还格外的孤独,不能说瘙痒难耐但也差不多等同于...
    大大师阅读 1,570评论 0 1