How do I embed location information

Asked on 07/31/2024

1 search

To embed location information as anchors in your app, you can use the spatial tracking session API in RealityKit. This allows you to provide your app access to the 3D location of anchors, enabling users to authorize which anchor capabilities they want to track. Here are the steps to achieve this:

  1. Create a Spatial Tracking Session: First, create a spatial tracking session.
  2. Configure for Plane Anchor Tracking: Set up a configuration for plane anchor tracking.
  3. Run the Session: Run the session with the configuration to prompt for authorization to plane anchored transforms.
  4. Add an Anchor: Specify a horizontal alignment for a target plane with floor classification to create a floor anchor entity to track.
  5. Add the Floor Anchor to the Reality View: Add the floor anchor to the reality view content in the immersive space.

For more detailed information, you can refer to the session Dive deep into volumes and immersive spaces (26:35).

Additionally, if you are working with object tracking, you can use the following steps:

  1. Provide a 3D Model: Provide a 3D model representing the real-world object you want to track.
  2. Create an Anchoring Component: Use RealityKit APIs to create your anchoring component at runtime.
  3. Augment with Virtual Content: Once the object is tracked, you can augment it with virtual content, such as labels or interactive elements.

For more details on object tracking, you can refer to the session Explore object tracking for visionOS (09:28).

Relevant Sessions

  1. Create enhanced spatial computing experiences with ARKit
  2. Dive deep into volumes and immersive spaces
  3. Explore object tracking for visionOS