var World = {
loaded: false,
trackableVisible: false,
resourcesLoaded: false,
init: function initFn() {
// AR.context.destroyAll();
this.createOverlays();
document.getElementById('loadingMessage').innerHTML =
"
Loading ....
";
},
createOverlays: function createOverlaysFn() {
//this.targetCollectionResource = new AR.TargetCollectionResource("https://bs2.cdn.telerik.com/v1/den6jccx4t2mjxwi/1f5b91e0-46b1-11e7-819f-b35b8e7a6a74", {
this.targetCollectionResource = new AR.TargetCollectionResource("assets/MainArtTracker.wtc", {
onLoaded: function () {
AR.logger.info(`Tracker loaded `);
},
onError: function (e) {
AR.logger.error(`${e.message} `);
}
});
this.tracker = new AR.ImageTracker(this.targetCollectionResource, {});
this.artModel = new AR.Model("https://firebasestorage.googleapis.com/v0/b/main-plinth-buzzin.appspot.com/o/finalPlinth2.wt3?alt=media&token=3bcfdfa7-94fa-4f44-9a62-2ed706429737",{
onLoaded: function () {
AR.logger.info(`Obj has Loaded `);
World.Loaded()
},
onError:function (e) {
AR.logger.info(`Error loading obj: ${e}`);
},
scale: {
x: 0.0195,
y: 0.0195,
z: 0.0195
},
translate: {
x: 0.0,
y: 0.0,
z: 0
},
rotate: {
x: 0,
y: 0,
z: 0
}
});
this.ufoAnimation1 = new AR.ModelAnimation(this.artModel,'Anim1_animation');
this.ufoAnimation2 = new AR.ModelAnimation(this.artModel,'Anim2_animation');
this.ufoAnimation3 = new AR.ModelAnimation(this.artModel,'Anim3_animation');
this.ufoAnimation4 = new AR.ModelAnimation(this.artModel,'Anim4_animation');
this.upBtn = new AR.ModelAnimation(this.artModel,'buttons_interest_point_1_animation');
this.spinBtn = new AR.ModelAnimation(this.artModel,'buttons_interest_point_2_animation');
this.infoBtn = new AR.ModelAnimation(this.artModel,'buttons_interest_point_3_animation');
this.takeoffBtn = new AR.ModelAnimation(this.artModel,'buttons_interest_point_4_animation');
this.lightBlue = new AR.ModelAnimation(this.artModel,'blue_light_01_animation');
this.lightBlue2 = new AR.ModelAnimation(this.artModel,'blue_light_02_animation');
this.redLight = new AR.ModelAnimation(this.artModel,'red_light_01_animation');
this.redLight2 = new AR.ModelAnimation(this.artModel,'red_light_02_animation');
this.yellowLight = new AR.ModelAnimation(this.artModel,'yellow_light_01_animation');
this.yellowLight2 = new AR.ModelAnimation(this.artModel,'yellow_light_02_animation');
this.artModel.onClick = function( drawable, model_part ) {
// AR.logger.error(`clicked `);
switch(model_part)
{
case 'buttons_interest_point_2':
World.spinBtn.start();
World.lightBlue.start();
World.lightBlue2.start();
World.redLight.start();
World.redLight2.start();
World.yellowLight.start();
World.yellowLight2.start();
setTimeout(function() {
World.ufoAnimation2.start();
}, 700);
break;
case 'buttons_interest_point_1':
World.upBtn.start();
World.lightBlue.start();
World.lightBlue2.start();
World.redLight.start();
World.redLight2.start();
World.yellowLight.start();
World.yellowLight2.start();
setTimeout(function() {
World.ufoAnimation1.start();
}, 1000);
break;
case 'buttons_interest_point_3':
World.infoBtn.start();
World.lightBlue.start();
World.lightBlue2.start();
World.redLight.start();
World.redLight2.start();
World.yellowLight.start();
World.yellowLight2.start();
setTimeout(function() {
World.ufoAnimation3.start();
}, 1000);
$("#popup-title").html(`Out of the gallery and into the City`);
$("#popup-details").html(`Collecting Malcolm Garrett – Snapshots from the World of Tomorrow: The Flying Saucer forms part of the current exhibition at MMU Special collections and is the second project to be digitally animated and launched on the Manchester Plinth. The Manchester Plinth showcases new digital interpretations of collections, transforming the way we view and engage with collections adapting the new "invisible" technologies as part of City Verve demonstrator, Manchester.`);
setTimeout(function() {
$("#popupDialog").popup("open");
}, 1000);
break;
case 'buttons_interest_point_4':
World.takeoffBtn.start();
World.lightBlue.start();
World.lightBlue2.start();
World.redLight.start();
World.redLight2.start();
World.yellowLight.start();
World.yellowLight2.start();
setTimeout(function() {
World.ufoAnimation4.start();
}, 1000);
break;
}
}
var trackable = new AR.ImageTrackable(this.tracker, "*", {
drawables: {
cam: [this.artModel]
}
});
},
Loaded: function loaded(params) {
var cssDivLeft = " style='display: table-cell;vertical-align: middle; text-align: left; padding-left: 10px'";
var cssDivRight = " style='display: table-cell;vertical-align: middle; text-align: right; width: 50%; padding-left: 15px;'";
document.getElementById('loadingMessage').innerHTML =
"Scan Target:
" +
"";
setTimeout(function() {
var e = document.getElementById('loadingMessage');
e.parentElement.removeChild(e);
}, 10000);
},
appear: function appearFn() {
World.trackableVisible = true;
if ( World.loaded ) {
World.resetModel();
World.appearingAnimation.start();
}
},
disappear: function disappearFn() {
World.trackableVisible = false;
}
};
// AR.logger.activateDebugMode();
World.init();