在 iOS 上如何使用 Spatial Scene 这个系统能力?
Asked on 06/19/2025
1 search
在 iOS 上使用 Spatial Scene 系统能力可以通过 RealityKit 实现。根据 WWDC 2025 的 "What’s new in RealityKit" 会议中提到的内容,Spatial Scenes 是一种从现有 2D 图像或照片生成的 3D 图像。它们具有真实的深度,并通过运动视差来增强空间场景的深度感。
要在 iOS 上使用 Spatial Scene,你可以使用 RealityKit 中的新组件 "Image Presentation Component"。这个组件支持三种类型的图像:传统的 2D 图像、立体照片(从 iPhone 或 Vision Pro 获取的立体照片)以及 Spatial Scenes。你可以通过以下步骤来实现:
- 使用 RealityKit 的 Image Presentation Component 来展示图像。
- 通过设置组件的所需查看模式为空间 3D 来生成空间场景。
- 在生成过程中,组件会显示进度动画,并在生成完成后立即显示空间场景。
你可以参考 What’s new in RealityKit (16:28) 以获取更多关于如何在应用中添加这些图像的代码示例。
此外,WWDC 2024 的 "Build compelling spatial photo and video experiences" 会议中也提到,Spatial Media 已经集成到现有的 Apple 框架中,如 AV Foundation、Photokit、Quicklook 和 Webkit。你可以通过这些框架轻松地将空间媒体添加到你的应用中。

What’s new in RealityKit
Unleash your creativity with new RealityKit features that can help you build rich 3D content for iOS, iPadOS, macOS, tvOS and visionOS. Learn how you can access ARKit data directly through RealityKit. Explore how you can interact with your 3D content more naturally using the object manipulation feature. Discover some new APIs for scene understanding, environment blending, instancing and much more, all using an interactive sample.

Keynote
Don’t miss the exciting reveal of the latest Apple software and technologies.

Build compelling spatial photo and video experiences
Learn how to adopt spatial photos and videos in your apps. Explore the different types of stereoscopic media and find out how to capture spatial videos in your iOS app on iPhone 15 Pro. Discover the various ways to detect and present spatial media, including the new QuickLook Preview Application API in visionOS. And take a deep dive into the metadata and stereo concepts that make a photo or video spatial.