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
Tweet

More Decks by Swift India

Other Decks in Technology

Transcript

  1. 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
  2. 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
  3. 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.
  4. • Plane Detection • Hit Testing • Light Estimation Scene

    Understanding Scene Understanding is the ability to determine attribute or properties about the environment around your device.
  5. 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.
  6. 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.
  7. 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
  8. Using ARKit • Step 1: Configuration – if ARWorldTrackingSessionConfiguration.isSupported {

    configuration = ARWorldTrackingSessionConfiguration() } else { configuration = ARSessionConfiguration() } }
  9. 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)
  10. 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)
  11. 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.