Start a new topic

Never getting closer of geoObject

Hi, i’m trying to make some examples with the geoLocation and the geoObjects. 

I put my coordinates (x,y,z) on a location, but when i place some 3d model in this location (in front of me, but fixed, not relative to me), i can’t never reach this place, the model always moves with me, and I don't understand how this is possible, if it’s a 3d model, on a fixed geolocation.

Can you help me?

 

var World = {
    loaded: false,

    init: function initFn() {

        this.createOverlays();
    },

    createOverlays: function createOverlaysFn() {

        var markerLoaded = false;

        function locationChanged (lat, long, alt, acc) {

            if (!markerLoaded){

                var oficina = new AR.GeoLocation(x, y, z);

                var modeloBatman = new AR.Model("assets/batman.wt3", {
                    scale: { x: 1, y: 1, z: 1 },
                    rotate: { roll: 0, tilt: 0, heading: 0 },
                    translate: { x: 0, y: 0, z: 0},
                });

                var indicadorResource = new AR.ImageResource("assets/indi.png");

                var indicador = new AR.ImageDrawable(indicadorResource, 0.1, {
                    enabled: true,
                    verticalAnchor: AR.CONST.VERTICAL_ANCHOR.TOP
                });

                var objetoBatman = new AR.GeoObject(oficina, {
                    drawables : {
                        cam : [modeloBatman],
                        indicator : [indicador]
                    }
                });

                AR.logger.debug("Added Batman");

                markerLoaded = true;
            }

            AR.logger.debug("Latitud: " + lat);
            AR.logger.debug("Longitud: " + long);
            AR.logger.debug("Altitud: " + alt);
            AR.logger.debug("Precisión: " + acc);
        }

        AR.logger.activateDebugMode();

        AR.context.onLocationChanged = locationChanged;
    }
};

World.init();

 

1 Comment

Hello Rafa,

As this is not expected behavior can you please send over your complete AR experience (.html, .css, .js files, assets, target images) so we can test internally?

Thanks
Eva

 

Login or Signup to post a comment