-
Meet Object Capture for iOS
Discover how you can offer an end-to-end Object Capture experience directly in your iOS apps to help people turn their objects into ready-to-use 3D models. Learn how you can create a fully automated Object Capture scan flow with our sample app and how you can assist people in automatically capturing the best content for their model. We'll also discuss LiDAR data and provide best practices for scanning objects.
Recursos
Videos relacionados
WWDC23
-
Buscar este video…
-
-
10:03 - Instantiating ObjectCaptureSession
import RealityKit import SwiftUI var session = ObjectCaptureSession() -
10:25 - Starting the session
var configuration = ObjectCaptureSession.Configuration() configuration.checkpointDirectory = getDocumentsDir().appendingPathComponent("Snapshots/") session.start(imagesDirectory: getDocumentsDir().appendingPathComponent("Images/"), configuration: configuration) -
10:50 - Creating ObjectCaptureView
import RealityKit import SwiftUI struct CapturePrimaryView: View { var body: some View { ZStack { ObjectCaptureView(session: session) } } } -
11:20 - Transition to detecting state
var body: some View { ZStack { ObjectCaptureView(session: session) if case .ready = session.state { CreateButton(label: "Continue") { session.startDetecting() } } } } -
11:36 - Showing ObjectCaptureView
var body: some View { ZStack { ObjectCaptureView(session: session) } } -
12:04 - Transition to capturing state
var body: some View { ZStack { ObjectCaptureView(session: session) if case .ready = session.state { CreateButton(label: "Continue") { session.startDetecting() } } else if case .detecting = session.state { CreateButton(label: "Start Capture") { session.startCapturing() } } } } -
12:27 - Showing ObjectCaptureView
var body: some View { ZStack { ObjectCaptureView(session: session) } } -
12:50 - Completed scan pass
var body: some View { if session.userCompletedScanPass { VStack { } } else { ZStack { ObjectCaptureView(session: session) } } } -
14:03 - Transition to finishing state
var body: some View { if session.userCompletedScanPass { VStack { CreateButton(label: "Finish") { session.finish() } } } else { ZStack { ObjectCaptureView(session: session) } } } -
15:00 - Point cloud view
var body: some View { if session.userCompletedScanPass { VStack { ObjectCapturePointCloudView(session: session) CreateButton(label: "Finish") { session.finish() } } } else { ZStack { ObjectCaptureView(session: session) } } } -
15:50 - Reconstruction API
var body: some View { ReconstructionProgressView() .task { var configuration = PhotogrammetrySession.Configuration() configuration.checkpointDirectory = getDocumentsDir() .appendingPathComponent("Snapshots/") let session = try PhotogrammetrySession( input: getDocumentsDir().appendingPathComponent("Images/"), configuration: configuration) try session.process(requests: [ .modelFile(url: getDocumentsDir().appendingPathComponent("model.usdz")) ]) for try await output in session.outputs { switch output { case .processingComplete: handleComplete() // Handle other Output messages here. }}}} -
17:02 - Capturing for Mac
// Capturing for Mac var configuration = ObjectCaptureSession.Configuration() configuration.isOverCaptureEnabled = true session.start(imagesDirectory: getDocumentsDir().appendingPathComponent("Images/"), configuration: configuration) -
18:40 - Pose output
// Pose output try session.process(requests: [ .poses .modelFile(url: modelURL), ]) for try await output in session.outputs { switch output { case .poses(let poses): handlePoses(poses) case .processingComplete: handleComplete() } }
-