Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2022 EssentialsSpatial Computing

WWDC22 · 19 min · Essentials / Spatial Computing

Discover ARKit 6

Discover how you can build more refined and powerful augmented reality apps with ARKit 6. We’ll explore how you can create AR experiences rendered in 4K HDR and take you through camera settings customizations for your app. We’ll also share how you can export high-resolution still images from an ARKit session, take advantage of Plane Estimation and Motion Capture, and add AR Location Anchors in new regions.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 5 snippets

HighRes Capturing swift · at 5:00 ↗
if let hiResCaptureVideoFormat = ARWorldTrackingConfiguration.recommendedVideoFormatForHighResolutionFrameCapturing {
    // Assign the video format that supports hi-res capturing.
config.videoFormat = hiResCaptureVideoFormat
}
// Run the session.
session.run(config)
highRes background photos swift · at 10:55 ↗
session.captureHighResolutionFrame { (frame, error) in
   if let frame = frame {
      saveHiResImage(frame.capturedImage)
   }
}
HDR support swift · at 12:00 ↗
if (config.videoFormat.isVideoHDRSupported) {
    config.videoHDRAllowed = true
}
session.run(config)
AVCapture Session swift · at 12:35 ↗
if let device = ARWorldTrackingConfiguration.configurableCaptureDeviceForPrimaryCamera {
   do {
      try device.lockForConfiguration()
      // configure AVCaptureDevice settings
      
      device.unlockForConfiguration()
   } catch {
      // error handling
      
   }
}
plane anchors swift · at 16:00 ↗
// Create a model entity sized to the plane's extent.
let planeEntity = ModelEntity(
    mesh: .generatePlane (
        width: planeExtent.width, 
        depth: planeExtent.height),
    materials: [material])

// Orient the entity.
planeEntity.transform = Transform(
    pitch: 0, 
    yaw: planeExtent.rotationOnYAxis, 
    roll: 0)

// Center the entity on the plane.
planeEntity.transform.translation = planeAnchor.center

Resources