Start a new topic

About model location

About model location

I want to create a model given a distance ahead me. I'm able to find my lat, long, altitude, and my facing direction.

I use these info to create: var geoLoc1 from my lat,LNG,alt. then var relLoc1 from distance (I.e. 10 m North, 0 East) relative to geoLoc1.

Then I create a model on this relLoc1. These 2 var were created using -useJS method (which (re)init the world with the new created model afterward.)


The model was created fine, but when I moved myself forth and back, or try to walk around, it didn't work. The model just followed me.

Does the model suppose to fix on geoLoc (plus slightly relative distance)? Did I do it the wrong way?

If I was wrong, how can I make my model stick to that lat/long? I want user to be able to look around the model that were fixed on the position.

My code:


this.model01 = new AR.Model(mName,{

onLoaded: this.loadingStep,


x: mScale,

y: mScale,

z: mScale



curLocation = new AR.GeoLocation(lat,lng,alt);

relLocation = new AR.RelativeLocation(curLocation,north,east,-1.5);

var locations = ;

var geoObj = new AR

.GeoObject(locations, {

  enabled: true,

  drawables : {

  cam : ,

  radar: radarCircle





What you want to do is possible using the way you described. However you have to keep in mind that GPS positions are not as accurate as one might hope. E.g. in urban scenarios the accuracy can be as bad as a couple of 10 meters. And if no GPS fix is avaiable the network positioning is used which has a worse accuracy. You can check the accuracy of the current location by assigning a function to the AR.context.onLocationChanged trigger and reading the value of the passed accuracy parameter.


Thus depending where you have tested this, try to move further around the object and check the location accuracy. It also helps to be in an open space where the gps accuracy is not affected by nearby buildings, trees or other objects.

OK. Thanks.
Login or Signup to post a comment