March 2018
Beginner
274 pages
6h 1m
English
Now that we understand how to track motion and have a service in place, let's see how we can put this service to use and visualize the tracked data in our AR app. Open up the spawn-at-surface.html page in a text editor and follow the given steps:
firebase.database().ref('pose/' + 1).set({x: 12,y: 1,z : 0}); //delete me
var idx = 1;setInterval(function(){ idx = idx + 1; if(camera){ camera.updateProjectionMatrix(); var pos = camera.position; var rot = camera.rotation; firebase.database().ref('pose/' + idx).set({x: pos.x,y: pos.y,z : pos.z, roll: rot._z, pitch: rot._x, yaw: rot._y }); } }, 1000); ...Read now
Unlock full access