ARKit experience chapter

AR profile

Augmented reality (Augmented Reality, referred to as AR), is the position and angle of a real-time calculation of the camera image and the image with the corresponding technology, the goal of this technology is set in the virtual world and interact with the real world on the screen.

ARKit experience chapter
AR
ARKit experience chapter
AR

IOS 11 introduces ARKit, a completely new framework that allows developers to easily create unparalleled augmented reality experiences for iPhone and iPad. By merging virtual objects and virtual information with the environment around the user, ARKit allows applications to jump out of screen limits so that they can interact with the real world in a completely new way.

Advantages of ARKit

  • ARKit dramatically reduces the difficulty of developers developing AR applications on iOS
  • Apple device popularity, making the threshold low, without other devices can experience
  • Developers can use Apple’s new machine learning framework, CoreML, to identify objects in the scene
  • Fast and stable motion localization
  • Estimation of plane and boundary, illumination estimation and scale estimation
  • Support for various development platforms or engines (e.g., Unity3d)

ARKit experience

Do not talk nonsense, first to experience the next. Yes, of course:

  • Xcode version: Xcode9 and above
  • IOS system: iOS11 and above
  • IOS device: processor A9 and above (6S models and above)
  • MacOS system: 10.12.4 and above

1. select Augemnted Reality App

ARKit experience chapter
1

2. fill in the information

ARKit experience chapter
2
  • Careful friends can see the Content Technology
    ARKit experience chapter
    Content Technology
    Scenekit:ARKit framework provides two AR technologies, one is based on the 3D scene (SceneKit) augmented reality
    SpriteKit implementation based on 2D scene (SpriktKit) enhanced by 3D
    Metal:Apple API
    Demo realistic graphics in the construction, so the choice of Scenekit

3.Run

ARKit experience chapter
effect

Project analysis

ARKit experience chapter
project structure
/ / create ARSCNView on the interface, used to display AR @IBOutlet var sceneView: ARSCNView override func! ViewDidLoad () {super.viewDidLoad (sceneView.delegate = self) / / proxy / / display some data, such as FPS, sceneView.showsStatistics = true / / create a SCNScene to display 3D let model scene = SCNScene (named: art.scnassets/ship.scn)! The 3D model will be loaded / / SCNScene set to ARSCNView scene sceneView.scene override func viewWillAppear} = scene (_ animated: Bool) {super.viewWillAppear (animated) / / set up a session configuration let configuration = ARWorldTrackingSessionConfiguration (ARSCNView) / / open Was session sceneView.session.run (configuration) override func viewWillDisappear (_} animated: {super.viewWillDisappear (Bool) animated) session (sceneView.session.pause)} / / pause

Through code analysis, you can see that there are several classes in ARKit

ARSCNView: a view that displays the AR experience, which enhances the camera view through the 3D SceneKit content

The ARWorldTrackingSessionConfiguration: session configuration class sets how the session maps the real device movement to the coordinate system of the 3D scene in the configuration class object, where gravity is used by default

A container for SCNScene: SceneKit content. You can load a scene from a file generated by the 3D modeling tool, or create one with the code, and then display it on the view

Experience feelings

  • ARKit API is simple enough, the effect is good enough.
  • Hardware, machine learning, CoreML and ARkit are full of surprises. I believe ARKit will shine in the future in the fields of photo processing, video, games and so on.