Search code examples
three.jsaframeargon

argon-aframe move with the users geolocation


I have this project:

my codepen

I want to be able to move forward when the user walks, so it feels like they are walking thru the floor plan in VR as they are in real life.

my goal is get the geolocation of the user and show them the room matching theirs location and have them walk around the room while viewing the AR on the phone they would see paintings on the walls.

my challenges are:

  • walk in real life and move in VR (right now I have it auto walking forward in the meantime)

var speed = 0.0; var iMoving = false; var velocityDelta;

AFRAME.registerComponent("automove-controls", {
  init: function() {
    this.speed = 0.1;
    this.isMoving = true;
    this.velocityDelta = new THREE.Vector3();
  },
  isVelocityActive: function() {
    return this.isMoving;
  },
  getVelocityDelta: function() {
    this.velocityDelta.z = this.isMoving ? -this.speed : 0;
    return this.velocityDelta.clone();
  }
});
  • capture the user geo location so the moment they open the site they are placed relative to their location on the floor plan

this is my first attempt so any feed back would be appreciated.


Solution

  • As far as i know argon.js is more about geoposition than spatial/marker based augmented reality.
    moreover It's quite worrying, that their repo for aframe was not touched for a while.


    Argon seems like a library for creating scenes in certain points around the user, even their examples base on positioning stuff around, reason being the GPS/phone accelerometers are way too bad to provide useful data for providing spatial positioning.
    Thats why VIVE needs two towers, and other devices at least a camera/IR device, to get information about the HMD device.


    Positioning the person inside a point depending where are they in a room is quite a difficult task, You would need to get a point of reference and position the user accordingly. It seems impossible, since the user can be anywhere in the world.
    I would try to do this using jerome-etienne's marker based AR.js.
    The markers would be the points of reference You need, and although image processing seems like a difficult task, AR.js is surprisingly stable with multiple markers, which help in creating complex scenes.

    The markers seems like a good idea, for they can help You with the positioning, moreover simple scenes have no problem with achieving 60+fps, making the experience quite comfortable.


    I would start there, since AR.js seems to be updated frequently.