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

ARKit in visionOS

shu223
December 19, 2023

ARKit in visionOS

「Mobile勉強会 Wantedly × チームラボ × Sansan #12」での発表資料です。
https://sansan.connpass.com/event/303229/

shu223

December 19, 2023
Tweet

More Decks by shu223

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • అ मҰ • @shu223 (GitHub, Qiita, Zenn, note,

    , YouTube, Podcast, etc...) • ॻ੶ʢ঎ۀग़൛4࡭ɺݸਓग़൛ଟ਺ @BOOTHʣ:
  2. visionOSͰ࢖͑ͳ͍ϑϨʔϜϫʔΫ 1 ActivityKit AdSupport AppClip AutomatedDeviceEnrollment BusinessChat CarKey CarPlay Cinematic

    ClockKit CoreLocationUI CoreMediaIO CoreNFC CoreTelephony DeviceActivity DockKit ExposureNotification FamilyControls FinanceKit FinanceKitUI ManagedSettings ManagedSettingsUI Messages MLCompute NearbyInteraction OpenAL ProximityReader RoomPlan SafetyKit ScreenTime SensorKit ServiceManagement Social Twitter WidgetKit WorkoutKit 1 Bringing your existing apps to visionOS | Apple Developer Documentation
  3. iOSͰͷARKitͷฏ໘ݕग़ͷίʔυ // ΞϯΧʔ͕௥Ճ͞ΕΔͱσϦήʔτϝιου͕ݺ͹ΕΔ func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode,

    for anchor: ARAnchor) { // ίϯϑΟΪϡϨʔγϣϯʹԠͨ͡ΞϯΧʔ͕ಘΒΕΔ guard let planeAnchor = anchor as? ARPlaneAnchor else { ... } ... }
  4. iOSͰͷARKitͷฏ໘ݕग़ͷίʔυ // ΞϯΧʔ͕௥Ճ͞ΕΔͱσϦήʔτϝιου͕ݺ͹ΕΔ func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode,

    for anchor: ARAnchor) { // ίϯϑΟΪϡϨʔγϣϯʹԠͨ͡ΞϯΧʔ͕ಘΒΕΔ guard let planeAnchor = anchor as? ARPlaneAnchor else { ... } ... } ⚠ ARSCNViewDelegate ɾɾɾvisionOSͰ࢖͑ͳ͍ ⚠ ARAnchor, ARPlaneAnchor ɾɾɾಉ্
  5. visionOSͰͷฏ໘ݕग़ͷίʔυ // ηογϣϯͱDataProviderͷॳظԽ let session = ARKitSession() let provider =

    PlaneDetectionProvider( alignments: [.horizontal, .vertical] ) // ηογϣϯ։࢝ try await session.run([provider])
  6. • ARKitSession ʢvisionOSʣ΋ ARSession ʢiOSʣ΋Ͳͪ Β΋ηογϣϯΛ؅ཧ • ࢖͍ํ΋ݶΓͳ͘ࣅ͍ͯΔ • Anchor

    ʢvisionOSʣͱ ARAnchor ʢiOSʣ΋͍͍ͩͨࣅͨ Α͏ͳ΋ͷ 2 2 visionOSʹ͓͚ΔARKit͸iOS൛ͱͲ͏มΘ͔ͬͨ
  7. ARKit in iOS • People Occulusion • Pose Detection •

    Face Tracking • Object Detection • ϑϨʔϜը૾ʹରͯ͠Core MLར༻ ͍͘ΒͰ΋खஈ͕͋Δ
  8. ARKit in visionOS • People Occulusion • Pose Detection •

    Face Tracking • Object Detection • ϑϨʔϜը૾ʹରͯ͠Core MLར༻ ͲΕ΋ෆՄ 4 4 น΍ఱҪ౳ͷʮ໘ʯΛݕग़͠छผΛಛఆ͢Δ͜ͱ͸Մೳ
  9. DeviceAnchorΛར༻ DeviceAnchor The position and orientation of Apple Vision Pro.

    • ૬ख΋Vision ProΛண͚͍ͯΕ͹Ґஔɾ޲͖͕Θ͔Δʁ • ͨͿΜࣗ෼ͷ͔͠औΕͳ͍ • Ծʹଞਓͷ΋औΕΔͱͯ͠ɺʮVision ProΛண͚͍ͯΔਓ ͚ͩʯ͸ଟ͘ͷϢʔεέʔεʹ߹Θͳ͍