Loading...
hs, elid){ var thehs = toScreenPosition(hs); if(thehs.z < 1){ $("#" + elid).css({ "top" : (thehs.y - ($("#" + elid).height()/2)) + "px", "left" : (thehs.x - ($("#" + elid).width()/2)) + "px", }); if(hotspotsvisible) $("#" + elid).show(); }else{ $("#" + elid).hide(); } } function toScreenPosition(obj) { var vector = new THREE.Vector3(); var widthHalf = 0.5 * innerWidth; var heightHalf = 0.5 * innerHeight; //obj.updateMatrixWorld(); vector.setFromMatrixPosition(obj.matrixWorld); vector.project(viewer.camera); vector.x = ( vector.x * widthHalf ) + widthHalf; vector.y = - ( vector.y * heightHalf ) + heightHalf; return { x: vector.x, y: vector.y, z: vector.z, }; }; var currentPanorama; function ChangePanorama(panorama){ currentPanorama = panorama; HideInfospots(); $("#loading").fadeIn(); //$(".customhotspot").fadeOut(); setTimeout(function(){ viewer.setPanorama(window[panorama]); }, 100); setTimeout(function(){ $("#" + panorama).fadeIn(); $("#loading").fadeOut(); }, 1000); } function HideInfospots(){ $(".customhotspot").fadeOut(); } /*customjs*/