How do I use ReferenceFileDocument?

Asked on 08/15/2024

1 search

To use ReferenceFileDocument, you would typically be working with object tracking in ARKit or visionOS. The process involves creating a reference object, which is a new file type introduced for object tracking. Here's a brief overview of how you can use it:

  1. Create a 3D Model: First, you need a 3D model of the real-world object you want to track. This model should be in the USDZ format.

  2. Train a Machine Learning Model: Use the CreateML app to train a machine learning model with your 3D asset. This process will generate a reference object.

  3. Load the Reference Object: Once you have the reference object, you can load it at runtime using a file URL or from a bundle. This is done using the new API provided by ARKit.

  4. Configure Object Tracking: After loading the reference object, configure a new object tracking provider with it and run it on an ARKit session.

  5. Process Tracking Results: Once the data provider is running, you can start processing incoming tracking results, which are delivered as object anchors.

For more detailed steps on creating a reference object, you can refer to the session Explore object tracking for visionOS (05:07).

Relevant Sessions