SpheroidUniverse / SpheroidScript

https://spheroiduniverse.github.io/SpheroidScript/
142 stars 15 forks source link

Request of explaination #13

Open Raffux opened 2 years ago

Raffux commented 2 years ago

Hi, I am writing to ask you for explanations on how to anchor a 3D model in a specific point of the globe using the coordinates and in particular how the GeoAnchor, Location, Worldanchor functions work, my development team and I are trying to use them taking a cue from how you used them in the CoinQuest example but it is difficult for us to understand how they work, I await an answer, I attach my email for a quickly response and collaboration if you want the appid, thanks chiappini.raffaele@gmail.com

SpheroidUniverse commented 2 years ago

Hello, Raffux.

GeoAnchor is a container that is needed to position objects by coordinates. All objects that you want to set by coordinates must be added to this container.

To set an object by coordinates, you need to set the "location" property of the "ModelNode" or "Node" object and add this object to the GeoAnchor children.

Location.onInit - GPS started working. First inaccurate data received from GPS Location.onUninit - GPS has stopped working. Location.onCorrect - this event indicates that the GeoAnchor container has been corrected, this is necessary so that the GeoAnchor container is always facing north. Location.onChange - this event indicates that the user has moved a certain distance.

See file "GeoAnchorExample"

WorldAnchor is a container that is needed to position objects relative to the AR scene. This container has nothing to do with geo-position and does not respond to correction.

See file "WorldAnchorExample"

WorldAnchorExample.txt GeoAnchorExample.txt