Start a new topic

Setting Geolocation of 3D object failing to anchor

We are using the Xamarin.Wikitude.SDK.JS at version 9.10.0.  We start up our application with an initial object location.  After the user opens a from to position the 3D box in a new location, we destroy the original model and recreate it in the new location.  This works for the most part except that the model will not stay anchored to that lat/long.  It will move with the phone and stay directly in front of the camera. I am updating the user location but the 3D model does not stay at the desired location.


tested with Huawei P10(android 7) and Google Pixel 5(latest version 12)


Hi,


Did you try our sample app to see if you can reproduce the same issue? https://www.wikitude.com/download-wikitude-sdk-for-xamarin/ If you follow the link  and download it you will see several samples on how to use Geolocation properly. Please, let me know if you are able to reproduce they same issue you are having and the steps.


Regards,

Aitor.

Hi Aitor,


I took your sample app of 3D model at Geolocation and changed your one line in 3dmodelatgeolocation.js from:

var location = new AR.RelativeLocation(null, 5, 0, 2);

 To: 

var location = new AR.GeoLocation(51.328974402685056, -0.5337034951957951);

 Those coords are within our offices so could be substituted for lat/long from anywhere.  


When I open the app and look at it, this exhibits the same behaviour of not locking to that point.  I can move completely past those coordinates and the 3D object stays in front of the camera no matter how far I walk. I'm guessing this will be because there is no tracking which shifts based on user location.

Your guess is right, anchors does not exist within our GeoLocation implementation. Nevertheless, you may have a possibility of having something similar by playing with the distanceTo() or the distanceToUser() methods and the 3D object scale. Here is the link to that specific method: https://www.wikitude.com/external/doc/documentation/latest/Reference/JavaScript%20API/classes/GeoLocation.html#method_distanceTo.

Login or Signup to post a comment