DirectX 中的共享体验Shared experiences in DirectX

备注

本文与旧版 WinRT 本机 Api 相关。This article relates to the legacy WinRT native APIs. 对于新的本机应用项目,建议使用 OPENXR APIFor new native app projects, we recommend using the OpenXR API.

共享体验是指多个用户使用其自己的 HoloLens、iOS 或 Android 设备,共同查看相同的全息影像并与之进行交互。A shared experience is one where multiple users with their own HoloLens, iOS, or Android device, collectively view and interact with the same hologram. 全息图使用空间锚点共享定位在空间的固定点上。The hologram is positioned at a fixed point in space using spatial anchor sharing.

Azure 空间定位点Azure Spatial Anchors

你可以使用 Azure 空间锚点 来创建支持云的持久空间锚点,你的应用可以在多个 HoloLens、IOS 和 Android 设备上查找。You can use Azure Spatial Anchors to create durable cloud-backed spatial anchors, which your app can then locate across multiple HoloLens, iOS and Android devices. 通过在多个设备之间共享公用空间定位点,每个用户都可以查看相对于同一物理位置中的定位点呈现的内容。By sharing a common spatial anchor across multiple devices, each user can see content rendered relative to that anchor in the same physical location. 这可实现实时共享体验。This allows for real-time shared experiences.

你还可以将 Azure 空间锚点 用于每个 HoloLens、IOS 和 Android 设备上的异步全息影像。You can also use Azure Spatial Anchors for asynchronous hologram persistence across HoloLens, iOS, and Android devices. 通过共享持久云空间锚点,多个设备可以在一段时间内观察到相同的持久全息图,即使这些设备同时不存在。By sharing a durable cloud spatial anchor, multiple devices can observe the same persisted hologram over time, even if those devices aren't present together at the same time.

若要开始在 HoloLens 应用中构建共享体验,请尝试5分钟的 Azure 空间锚快速入门To get started building shared experiences in your HoloLens app, try out the 5-minute Azure Spatial Anchors HoloLens quickstart.

启动并运行 Azure 空间锚点后,可以 在 HoloLens 上创建和查找锚Once you're up and running with Azure Spatial Anchors, you can then create and locate anchors on HoloLens. 演练也适用于 Android 和 iOS ,使你能够在所有设备上共享相同的定位标记。Walkthroughs are available for Android and iOS as well, enabling you to share the same anchors on all devices.

本地定位点传输Local anchor transfers

在不能使用 Azure 空间锚点的情况下, 本地定位点传输 允许一台 hololens 设备导出要由第二个 hololens 设备导入的定位点。In situations where you can't use Azure Spatial Anchors, local anchor transfers enable one HoloLens device to export an anchor to be imported by a second HoloLens device. 此方法提供的定位回调不如 Azure 空间锚,而且不支持 iOS 和 Android 设备。This approach provides less robust anchor recall than Azure Spatial Anchors, and iOS and Android devices are not supported by this approach.

另请参阅See also