Skip to content

Instantly share code, notes, and snippets.


Al Murray rogueyoshi

View GitHub Profile
rogueyoshi / relocalize.cs
Last active Aug 28, 2020
ARFoundation Simple Re-Localization using only Tracked Images
View relocalize.cs
// A simple way to create persistent AR experiences just from a single (or more) tracked image alone.
// After the image is found, ARFoundation SLAM works it's magic for position tracking.
// To use: Create your scene in Unity as you would for a normal project and place one or more objects corresponding to the sync point.
// This presumes you have a scene with objects in Unity space corresponding to where they would appear physically.
// Make sure that the objects in Unity space corresponding to the image targets has the same pose as it would in physical space.
// Requires an ARTrackedImageManagerComponent
private void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs imageEventArgs)
foreach (var updatedImage in imageEventArgs.updated)