Hello,
Using the sample code above, it gets stuck on 'loading...' and never advances.
I'm using iOS Xamarin project. Any ideas what's wrong?
// Sample experience to show 3D Model in Geo-AR var World = { PATH_INDICATOR : "assets/indi.png", // use direction indicator from samples PATH_MODEL_WT3 : "assets/earth.wt3", // use model from samples MSG_VISIBLE : "Here it is!", MSG_NOTVISIBLE : "There is a model nearby!", FEEDBACK_DIV : document.getElementById('loadingMessage'), init: function initFn() { // wait for first location signal before creating the experience to ensure you know user's location during setup process AR.context.onLocationChanged = function(latitude, longitude, altitude, accuracy){ // store user's location so you have access to it at any time World.myLocation = {"latitude": latitude, "longitude" : longitude, "altitude" : altitude }; // create model around the user on very first location update if (!World.created) { World.FEEDBACK_DIV.innerHTML = 'Loading...'; World.created = true; World.createModelAtLocation(World.myLocation); } }; }, createModelAtLocation: function createModelAtLocationFn(location) { // place object around the user, in this case just a few meters next to the user. Note that the object will stay where it is, so user can move around it. World.modelGeoLocation = new AR.GeoLocation(location.latitude - 0.005, location.longitude + 0.0005, AR.CONST.UNKNOWN_ALTITUDE); // load model from asset directory World.model = new AR.Model(World.PATH_MODEL_WT3, { // trigger animation once asset was loaded onLoaded: function() { // trigger loading of directin indicator World.indicatorImage = new AR.ImageResource(World.PATH_INDICATOR); // create indicator drawable using the image resource World.indicatorDrawable = new AR.ImageDrawable(World.indicatorImage, 0.1, { verticalAnchor: AR.CONST.VERTICAL_ANCHOR.TOP }); // define geoObject, including its direction indicator World.geoObject = new AR.GeoObject(World.modelGeoLocation, { drawables: { cam: World.model, indicator: World.indicatorDrawable }, onEnterFieldOfVision: function() { World.modelVisible = true; World.FEEDBACK_DIV.innerHTML = World.MSG_VISIBLE; }, onExitFieldOfVision: function() { World.modelVisible = false; World.FEEDBACK_DIV.innerHTML = World.MSG_NOTVISIBLE; }, onClick: function() { console.log('clicked model'); } }); World.worldLoaded(); }, onError: function(err) { World.worldError('Could not load file.'); }, scale: { x: 0.3, y: 0.3, z: 0.3 }, translate: { x: 0, y: 0.5, z: 0 }, rotate: { heading: 180, tilt: -40 } }); }, worldLoaded: function worldLoadedFn() { World.loaded = true; World.FEEDBACK_DIV.innerHTML = World.modelVisible ? World.MSG_VISIBLE : World.MSG_NOTVISIBLE; }, worldError: function worldErrorFn(msg) { World.FEEDBACK_DIV.innerHTML = msg ? msg : 'unexpected error'; } }; World.init();
Augustjason