androidarcore

How to store the coordinates of Augemented Reality objects positions relative to other objects?


I'm trying to build an Android app using ARCore, where the user can places objects next to each other. Once they close the game, I want them to be able to reload all the assets and place them in the same positions before the game was closed.

What data should I be saving in order to redraw the objects relative to the other objects in the scene?enter image description here


Solution

  • You should be saving the (x, y) positions of the player (Phone), then finding where the objects should be in the real world (Using position). Also, save the phone rotation to find what direction the scene renders in.

    The phone on load position should be equal in the engine to the phone's last position in the scene. Even if the phone has moved to other places in the real world.