mapbox-unity-sdk icon indicating copy to clipboard operation
mapbox-unity-sdk copied to clipboard

How to placing AR object at specific longitude and latitude?

Open a100447739 opened this issue 8 years ago • 5 comments

I am using WorldScaleAR scene and wondering how to place AR object at specific longitude and latitude?

a100447739 avatar Mar 27 '18 11:03 a100447739

Hi! You can use the GeoToWorldPosition method in the AbstractMap class.

doerrdude avatar Apr 01 '18 15:04 doerrdude

@a100447739 Use the GeoToWorldPosition method on the AbstractMap to get positions in Map space. You can use these positions to spawn your objects.

Or if you want to have custom data, you might want to create a custom dataset using Mapbox Studio and create a tileset to consume in Unity. Let me know which option solves your problem best and we can make sure you have all the information you need.

abhishektrip avatar Apr 02 '18 16:04 abhishektrip

Could this work on a tabletop size AR map as well? I am searching for a way to add spatial sound anchored to specific coordinates. Both on the World scale and tabletop maps.

campeezjesse avatar Apr 03 '18 21:04 campeezjesse

@campeezjesse yes, it should work.

abhishektrip avatar Apr 03 '18 21:04 abhishektrip

Hello! I'm coming to unity from unreal so very new to the scripting side. I have added the abstract map script to a cube as a component. I tried changing the general settings Lat/long to position the cube to a real world location about 10 metres from my window, but when deployed to the phone it is at the player origin. Which part of the AbstractMap script do I add the GeoToWorldPosition element to? Or is it already present in the script and I just have to change some numbers? Thanks in advance!

josefsHD avatar Jun 18 '21 17:06 josefsHD