Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ARKit by Yogesh Bhatt

ARKit by Yogesh Bhatt


Swift India

July 08, 2017


  1. ARKit

  2. Augmented Reality • It is a technology that superimposes a

    computer-generated image on a user's view of the real world, thus providing a composite view. • It creates the illusion that virtual object placed in the physical world
  3. ARKit ARKit is Mobile AR Platform that provides high level

    api to create Augmented Reality applications. It support all A9 and up iOS Devices. The major components of ARKit are :- • Tracking • Scene Understanding • Rendering
  4. Tracking 1. World Tracking 2. Visual Inertial Odometry 3. No

    External Setup Tracking provides the ability to track devices in real time. With world tracking we can get device relative position in physical environment.
  5. • Plane Detection • Hit Testing • Light Estimation Scene

    Understanding Scene Understanding is the ability to determine attribute or properties about the environment around your device.
  6. Rendering • Easy Integration • AR Views • Custom Rendering

  7. Basic ARKit Concepts • Session A shared object that manages

    the device camera and motion processing needed for augmented reality experiences. • Configuration ARKit provides tracking based on device capabilities. ARSessionConfiguration is used for less capable devices, and it only tracks device orientation.ARWorldTrackingSession Configuration is used for fully-capable devices, and it tracks device orientation, relative position, and scene information. Additional AR session features can be enabled or disabled through these configuration classes.
  8. Basic ARKit Concepts • Frames It contains a captured image,

    detailed tracking, and scene information which contains the current tracking points and lighting conditions. • Anchors An anchor is a position and orientation in real-world space. ARKit will maintain that position and orientation for you as you move the camera around.
  9. Basic ARKit Concepts • Planes A plane is a detected

    surface like a floor or a table surface. When enabled, ARKit will detect, maintain, and track available surfaces in the real-world space. You can then use these surfaces to place your content, which will appear on top of the surface. • Lighting ARKit also tracks the current lighting conditions, which can be used to properly light virtual content in a more believable fashion
  10. Using ARKit • Step 1: Configuration – if ARWorldTrackingSessionConfiguration.isSupported {

    configuration = ARWorldTrackingSessionConfiguration() } else { configuration = ARSessionConfiguration() } }
  11. Using ARKit • STEP 2: Create and Start the AR

    Session // Create an AR Session let arSession = ARSession() // Nominate self for session delegation arSession.delegate = self // Run the session arSession.run(configuration)
  12. Using ARKit • STEP 3: Managing an AR session //

    PAUSE. This will suspend all AR processing. session.pause() // RESUME. This will resume the AR session and continue processing. session.run(session.configuration) // CHANGE. This will change or update the configuration, should you want to do so. session.run(newConfiguration) // RESET. This will restart the session tracking process from scratch. session.run(configuration, options: .resetTracking)
  13. Using ARKit STEP 4: Handle Session Updates • Frame Updates.

    func session(_: ARSession, didUpdate: ARFrame) provides a detailed frame by frame update. The ARFrame contains a captured image, tracking and scene information, feature points, and lighting conditions. • Anchor Added. func session(_: ARSession, didAdd: [ARAnchor]) gets called when an anchor gets added to the AR session. Anchors can be added by calling session.add(anchor: newAnchor). • Anchor Updated. func session(_: ARSession, didUpdate: [ARAnchor]) gets called when and anchor requires an update.
  14. References • https://developer.apple.com/documentation/arkit • https://www.youtube.com/watch?v=LLRweyZ1KpA&t=2708s • https://blog.markdaws.net/@dawson.mark • http://dayoftheindie.com/tutorials/3d-games-graphics/tutorial- intro-arkit-scenekit/

  15. Thank You Yogesh Bhatt yogesh774@gmail.com