var DMD_IOS_baohzs_1501849863 = (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?true:false); var DMD_ANDROID_baohzs_1501849863 = (navigator.userAgent.toLowerCase().match(/(android)/g)?true:false)&&(navigator.userAgent.toLowerCase().match(/(windows phone)/g)?false:true); var DMD_WINDOWSPHONE_baohzs_1501849863 = (navigator.userAgent.toLowerCase().match(/(windows phone)/g)?true:false); var DMD_IS_MOBILE_baohzs_1501849863=DMD_IOS_baohzs_1501849863 || DMD_ANDROID_baohzs_1501849863 || DMD_WINDOWSPHONE_baohzs_1501849863; var DMD_CFG_DOMAIN_URL = "http://www.dermandar.com/"; var DMD_CFG_STATIC_DOMAIN_URL = "http://static.dermandar.com/"; if (window.location.protocol == "https:") { DMD_CFG_DOMAIN_URL = "https://www.dermandar.com/"; DMD_CFG_STATIC_DOMAIN_URL = "https://static.dermandar.com/"; }; var DMD_PID_GL_baohzs_1501849863="baohzs"; var DMD_CAN_ADD_GYRO_GL_baohzs_1501849863=true; if(typeof(dmd_rem_gyro)!=="undefined") DMD_CAN_ADD_GYRO_GL_baohzs_1501849863=!dmd_rem_gyro; var DMD_PANO_READY_GL_baohzs_1501849863=false; var DMD_ISGYROCONTROLS_DISPLAYED_GL_baohzs_1501849863=false; var DMD_ISGYROENABLED_GL_baohzs_1501849863=true; var DMD_ISGYROAVAILABLE_GL_baohzs_1501849863=false; var DMD_ORIENTATION_GL_baohzs_1501849863=0; var DMD_PREVQUAT_GL_baohzs_1501849863=null; function multQuaternionGL_baohzs_1501849863(q1,q2) { var result = [ q1[0]*q2[0]-q1[1]*q2[1]-q1[2]*q2[2]-q1[3]*q2[3], q1[0]*q2[1]+q1[1]*q2[0]+q1[2]*q2[3]-q1[3]*q2[2], q1[0]*q2[2]-q1[1]*q2[3]+q1[2]*q2[0]+q1[3]*q2[1], q1[0]*q2[3]+q1[1]*q2[2]-q1[2]*q2[1]+q1[3]*q2[0] ]; return result; } var sHp = -9999999; var sPp = -9999999; var DMD_GYRO_INITED_GL_baohzs_1501849863 = false; var DMD_SS_PASSED2SECS_GL_baohzs_1501849863=false; var DMD_SS_HOLDER_GL_baohzs_1501849863=document.createElement("div"); DMD_SS_HOLDER_GL_baohzs_1501849863.style.backgroundColor="#0f3c78"; DMD_SS_HOLDER_GL_baohzs_1501849863.style.width="100%"; DMD_SS_HOLDER_GL_baohzs_1501849863.style.height="100%"; DMD_SS_HOLDER_GL_baohzs_1501849863.style.position="absolute"; DMD_SS_HOLDER_GL_baohzs_1501849863.style.top=0; DMD_SS_HOLDER_GL_baohzs_1501849863.style.left=0; DMD_SS_HOLDER_GL_baohzs_1501849863.style.display="block"; DMD_SS_HOLDER_GL_baohzs_1501849863.style.zIndex=99999999; DMD_SS_HOLDER_GL_baohzs_1501849863.style.margin="auto"; var dmdSSImg=new Image(); dmdSSImg.onload=function(e) { var img=document.createElement("img"); img.style.maxWidth="100%"; img.style.maxHeight="100%"; img.style.margin="auto"; img.style.position="absolute"; img.style.top=0; img.style.bottom=0; img.style.left=0; img.style.right=0; img.style.border="0px none transparent"; img.src=this.src; DMD_SS_HOLDER_GL_baohzs_1501849863.appendChild(img); setTimeout(function() { DMD_SS_PASSED2SECS_GL_baohzs_1501849863=true; },2000); }; dmdSSImg.src=DMD_CFG_STATIC_DOMAIN_URL+"design/images/img/splash.png?v=0.0.1"; var dmd_delta_time=function() { this.delta=new Date().getTime(); this.get_delta_t=function() { var currnet=new Date().getTime(); var diff=currnet-this.delta; this.delta=currnet; return diff/1000.; }; }; var dmd_delta=new dmd_delta_time(); function dmdStartReadGyroSensorsMotionGL_baohzs_1501849863(gyro) { var pano=eval("pano_"+DMD_PID_GL_baohzs_1501849863); if(!DMD_SS_PASSED2SECS_GL_baohzs_1501849863)return; else if((DMD_SS_HOLDER_GL_baohzs_1501849863!=null)&&(DMD_SS_HOLDER_GL_baohzs_1501849863.parentNode!=null) && (pano!=null))pano.cvs.style.display="",DMD_SS_HOLDER_GL_baohzs_1501849863.parentNode.removeChild(DMD_SS_HOLDER_GL_baohzs_1501849863); else if(pano!=null)pano.cvs.style.display=""; var gRadian = {x:999, y:999, z:999}; if (gyro.rotationRate) { if(DMD_ANDROID_baohzs_1501849863) { gRadian = { x:gyro.rotationRate.beta, y:gyro.rotationRate.gamma, z:gyro.rotationRate.alpha }; } else { gRadian = { x:gyro.rotationRate.beta * Math.PI / 180., y:gyro.rotationRate.gamma * Math.PI / 180., z:gyro.rotationRate.alpha * Math.PI / 180. }; } } else { window.removeEventListener("devicemotion", dmdStartReadGyroSensorsMotionGL_baohzs_1501849863); window.addEventListener("deviceorientation", dmdStartReadGyroSensorsGL_baohzs_1501849863); return; } var dt=dmd_delta.get_delta_t(); DMD_ISGYROAVAILABLE_GL_baohzs_1501849863 = (gyro!=null); if (!DMD_GYRO_INITED_GL_baohzs_1501849863 && DMD_ISGYROAVAILABLE_GL_baohzs_1501849863) { if(DMD_ISGYROENABLED_GL_baohzs_1501849863 && (DMD_PID_GL_baohzs_1501849863 !=="")) { pano.startGyro(); DMD_GYRO_INITED_GL_baohzs_1501849863 = true; } dmdAddGyroGL_baohzs_1501849863(); } if (!DMD_ISGYROENABLED_GL_baohzs_1501849863 || !DMD_GYRO_INITED_GL_baohzs_1501849863 || (DMD_PID_GL_baohzs_1501849863=="")) return; if (!DMD_PANO_READY_GL_baohzs_1501849863) return; if (DMD_ORIENTATION_GL_baohzs_1501849863==1 || DMD_ORIENTATION_GL_baohzs_1501849863==-1) { pano.controls.H+=gRadian.z*dt*DMD_ORIENTATION_GL_baohzs_1501849863; pano.controls.P-=gRadian.x*dt*DMD_ORIENTATION_GL_baohzs_1501849863; //pano.controls.R+=gRadian.y*dt; } else if (DMD_ORIENTATION_GL_baohzs_1501849863==0) { pano.controls.H+=gRadian.x*dt; pano.controls.P+=gRadian.z*dt; //pano.controls.R+=gRadian.y*dt; } else if (DMD_ORIENTATION_GL_baohzs_1501849863==-2) { pano.controls.H-=gRadian.x*dt; pano.controls.P-=gRadian.z*dt; //pano.controls.R-=gRadian.y*dt; } pano.controls.checkHPF(); }; function dmdStartReadGyroSensorsGL_baohzs_1501849863(gyro) { var pano=eval("pano_"+DMD_PID_GL_baohzs_1501849863); if(!DMD_SS_PASSED2SECS_GL_baohzs_1501849863)return; else if((DMD_SS_HOLDER_GL_baohzs_1501849863!=null)&&(DMD_SS_HOLDER_GL_baohzs_1501849863.parentNode!=null) && (pano!=null))pano.cvs.style.display="",DMD_SS_HOLDER_GL_baohzs_1501849863.parentNode.removeChild(DMD_SS_HOLDER_GL_baohzs_1501849863); else if(pano!=null)pano.cvs.style.display=""; if(!DMD_IOS_baohzs_1501849863&&!DMD_ANDROID_baohzs_1501849863) return; DMD_ISGYROAVAILABLE_GL_baohzs_1501849863 = (gyro!=null); if (!DMD_GYRO_INITED_GL_baohzs_1501849863 && DMD_ISGYROAVAILABLE_GL_baohzs_1501849863) { if(DMD_ISGYROENABLED_GL_baohzs_1501849863 && (DMD_PID_GL_baohzs_1501849863 !=="")) { pano.startGyro(); DMD_GYRO_INITED_GL_baohzs_1501849863= true; } dmdAddGyroGL_baohzs_1501849863(); } if (!DMD_ISGYROENABLED_GL_baohzs_1501849863 || !DMD_GYRO_INITED_GL_baohzs_1501849863 || (DMD_PID_GL_baohzs_1501849863=="")) return; var gRadian = { x:gyro.beta * Math.PI / 180., y:gyro.gamma * Math.PI / 180., z:gyro.alpha * Math.PI / 180. }; var gamma1 = Math.cos(gRadian.z/2.), gamma2 = Math.cos(gRadian.x/2.), gamma3 = Math.cos(gRadian.y/2.); var sigma1 = Math.sin(gRadian.z/2.), sigma2 = Math.sin(gRadian.x/2.), sigma3 = Math.sin(gRadian.y/2.); var Quat=[ gamma1*gamma2*gamma3 - sigma1*sigma2*sigma3, gamma1*sigma2*gamma3 - sigma1*gamma2*sigma3, sigma1*sigma2*gamma3 + gamma1*gamma2*sigma3, sigma1*gamma2*gamma3 + gamma1*sigma2*sigma3 ]; if (DMD_PREVQUAT_GL_baohzs_1501849863 == null){ DMD_PREVQUAT_GL_baohzs_1501849863 = [ Quat[0], Quat[1], Quat[2], Quat[3] ]; return; } var prev_quaternion_inverse = [ DMD_PREVQUAT_GL[0], -DMD_PREVQUAT_GL[1], -DMD_PREVQUAT_GL[2], -DMD_PREVQUAT_GL[3] ]; var q1inv_q2 = multQuaternionGL_baohzs_1501849863(prev_quaternion_inverse, Quat); if (q1inv_q2[0] > 1.) q1inv_q2[0] = 1.; if (q1inv_q2[0] < -1.) q1inv_q2[0] = -1.; if (q1inv_q2[0] < 0.) { q1inv_q2[0] *= -1.; q1inv_q2[1] *= -1.; q1inv_q2[2] *= -1.; q1inv_q2[3] *= -1.; } //var uX = 1., uY = 0., uZ = 0., angle = Math.acos(Math.abs(q1inv_q2[0])) * 2.; var uX = 1., uY = 0., uZ = 0., angle = Math.acos(q1inv_q2[0]) * 2.; var sAngle = Math.sin(angle * .5); if (Math.abs(sAngle) > 10e-20) { var one_over_sin_Angle = 1. / sAngle; uX = q1inv_q2[1] * one_over_sin_Angle; uY = q1inv_q2[2] * one_over_sin_Angle; uZ = q1inv_q2[3] * one_over_sin_Angle; } var angularRotationSpeed=[ angle * uX, angle * uY, angle * uZ ]; DMD_PREVQUAT_GL_baohzs_1501849863 = [Quat[0], Quat[1], Quat[2], Quat[3]]; if (sHp == -9999999) { if (DMD_ORIENTATION_GL_baohzs_1501849863) { sHp = angularRotationSpeed[0]*DMD_ORIENTATION_GL_baohzs_1501849863; sPp = angularRotationSpeed[1]*(-DMD_ORIENTATION_GL_baohzs_1501849863); } else { sHp = angularRotationSpeed[1]; sPp = angularRotationSpeed[0]; } return; } var sHc, sPc; if (DMD_ORIENTATION_GL_baohzs_1501849863==1 || DMD_ORIENTATION_GL_baohzs_1501849863==-1) { sHc = sHp*0.7+angularRotationSpeed[0]*DMD_ORIENTATION_GL_baohzs_1501849863*0.3; sPc = sPp*0.7+angularRotationSpeed[1]*(-DMD_ORIENTATION_GL_baohzs_1501849863)*0.3; } else if (DMD_ORIENTATION_GL_baohzs_1501849863==0) { sHc = sHp*0.7+angularRotationSpeed[1]*0.3; sPc = sPp*0.7+angularRotationSpeed[0]*0.3; } else if (DMD_ORIENTATION_GL_baohzs_1501849863==-2) { sHc = (sHp*0.7-angularRotationSpeed[1]*0.3); sPc = (sPp*0.7-angularRotationSpeed[0]*0.3); } if (!DMD_PANO_READY_GL_baohzs_1501849863) return; pano.controls.H+=sHc; sHp = sHc; pano.controls.P-=sPc; sPp = sPc; pano.controls.checkHPF(); }; function dmdAddGyroGL_baohzs_1501849863() { var gDim=48; if (DMD_ISGYROCONTROLS_DISPLAYED_GL_baohzs_1501849863 || !DMD_ISGYROAVAILABLE_GL_baohzs_1501849863 || (!DMD_IOS_baohzs_1501849863 && !DMD_ANDROID_baohzs_1501849863)) { if(DMD_IOS_baohzs_1501849863 || DMD_ANDROID_baohzs_1501849863) DMD_ISGYROAVAILABLE_GL_baohzs_1501849863=false; return; }; DMD_ISGYROCONTROLS_DISPLAYED_GL_baohzs=true; if(window.orientation == 90) DMD_ORIENTATION_GL_baohzs_1501849863 = 1; else if (window.orientation == -90) DMD_ORIENTATION_GL_baohzs_1501849863 = -1; else if (window.orientation == 0) DMD_ORIENTATION_GL_baohzs_1501849863 = 0; else DMD_ORIENTATION_GL_baohzs_1501849863 = -2; var bdy=document.getElementById(DMD_SHARED_CANVAS.id).parentNode; var bdyGyroHolder=document.createElement("div"); bdyGyroHolder.innerHTML='
'; bdyGyroHolder.id="dmd_gyro_holder_"+DMD_PID_GL_baohzs_1501849863; bdy.appendChild(bdyGyroHolder); var dmd_gyro_holder = document.getElementById("gyroholder"); var dmd_gyro = document.getElementById("gyroBtn"); dmd_gyro_holder.style.zIndex="999999999"; dmd_gyro_holder.style.display="block"; dmd_gyro_holder.style.position="absolute"; dmd_gyro_holder.style.width=((DMD_ISGYROENABLED_GL_baohzs_1501849863) ? "100%" : gDim+"px"); dmd_gyro_holder.style.height=((DMD_ISGYROENABLED_GL_baohzs_1501849863) ? "100%" : gDim+"px"); dmd_gyro_holder.style.left="0"; dmd_gyro_holder.style.top="0"; dmd_gyro_holder.ontouchstart=function(e) { e.preventDefault(); eval("pano_"+DMD_PID_GL_baohzs_1501849863).tchstart(e); return false; }; dmd_gyro_holder.ontouchmove=function (e) { eval("pano_"+DMD_PID_GL_baohzs_1501849863).tchmove(e); e.preventDefault(); return false; }; dmd_gyro_holder.ontouchend=function (e) { if(e.touches.length<2) { var p=eval("pano_" + DMD_PID_GL_baohzs_1501849863); var hs=p.controls.prevH-p.controls.prevprevH; var ps=p.controls.prevP-p.controls.prevprevP; p.gstrend(e); p.shortAutoplay(hs,ps); } e.preventDefault(); return false; }; dmd_gyro.style.display="block"; dmd_gyro.style.position="absolute"; dmd_gyro.style.width=gDim+"px"; dmd_gyro.style.height=gDim+"px"; dmd_gyro.style.top="0px"; dmd_gyro.style.left="0px"; dmd_gyro.style.zIndex="999999999"; if(DMD_ISGYROENABLED_GL_baohzs_1501849863) { dmd_gyro.style.opacity=1.0; } else { dmd_gyro.style.opacity=0.5; } dmd_gyro.ontouchstart=function(e) { e.preventDefault(); DMD_ISGYROENABLED_GL_baohzs_1501849863=!DMD_ISGYROENABLED_GL_baohzs_1501849863; if (!DMD_ISGYROENABLED_GL_baohzs_1501849863) { dmd_gyro.style.opacity=0.5; dmd_gyro_holder.style.width=gDim+"px"; dmd_gyro_holder.style.height=gDim+"px"; /*eval("pano_"+DMD_PID_GL_baohzs_1501849863).controls.R=0;*/ } else { eval("pano_"+DMD_PID_GL_baohzs_1501849863).startGyro(); dmd_gyro_holder.style.width="100%"; dmd_gyro_holder.style.height="100%"; dmd_gyro.style.opacity=1.0; } return false; }; }; var getAjaxReq=function(url, callback) { var xmlhttp=null; xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { try { if(callback)callback(JSON.parse(xmlhttp.responseText)); } catch(e) { setTimeout(function() { getAjaxReq(url, callback); }, 1000); } } else if (xmlhttp.readyState==4 && xmlhttp.status!=200) { setTimeout(function() { getAjaxReq(url, callback); }, 1000); } } xmlhttp.open("GET",url,true); xmlhttp.send(); }; var tex=function(viewer) { this.texture=0; this.viewer=viewer; this.init=function() { this.texmak=0; this.tb=null; }; this.loadtex=function(img) { if(!(this.viewer&&this.viewer.gl))return; this.texture=this.viewer.gl.createTexture(); this.viewer.gl.bindTexture(this.viewer.gl.TEXTURE_2D,this.texture); this.viewer.gl.texImage2D(this.viewer.gl.TEXTURE_2D,0,this.viewer.gl.RGBA,this.viewer.gl.RGBA,this.viewer.gl.UNSIGNED_BYTE,img); this.viewer.gl.texParameteri(this.viewer.gl.TEXTURE_2D,this.viewer.gl.TEXTURE_MAG_FILTER,this.viewer.gl.LINEAR); this.viewer.gl.texParameteri(this.viewer.gl.TEXTURE_2D,this.viewer.gl.TEXTURE_MIN_FILTER,this.viewer.gl.LINEAR); this.viewer.gl.texParameteri(this.viewer.gl.TEXTURE_2D,this.viewer.gl.TEXTURE_WRAP_S,this.viewer.gl.CLAMP_TO_EDGE); this.viewer.gl.texParameteri(this.viewer.gl.TEXTURE_2D,this.viewer.gl.TEXTURE_WRAP_T,this.viewer.gl.CLAMP_TO_EDGE); this.width=img.width; this.height=img.height; }; this.use=function(){ this.viewer.gl.bindTexture(this.viewer.gl.TEXTURE_2D,this.texture); }; this.destroy=function() { this.viewer.gl.deleteTexture(this.texture); this.texture=null; }; this.init(); }; var DMDTimer=function() { this.delta=new Date().getTime(); this.getDelta=function() { var currnet=new Date().getTime(); var diff=currnet-this.delta; this.delta=currnet; return diff/1000.; }; }; var DMDControls_baohzs=function() { var _0xcd45=["\x48","\x46\x6D\x69\x6E","\x50","\x52","\x46","\x41\x53\x50","\x70\x61\x72\x74\x69\x61\x6C","\x48\x31\x70\x72","\x48\x32\x70\x72","\x50\x31\x70\x72","\x50\x32\x70\x72","\x46\x31\x70\x72","\x46\x32\x70\x72","\x73\x74\x6F\x70\x41\x74","\x74\x61\x75","\x64\x74\x6D","\x74\x74","\x48\x64\x69\x72","\x50\x64\x69\x72","\x63\x68\x61\x6E\x67\x65\x64","\x74\x72\x61\x6E\x73","\x6D\x6F\x76\x69\x6E\x67","\x74\x65\x6A\x6A","\x61\x75\x74\x6F\x70\x6C\x61\x79\x65\x64","\x70\x72\x65\x76\x70\x72\x65\x76\x48","\x70\x72\x65\x76\x48","\x70\x72\x65\x76\x70\x72\x65\x76\x50","\x70\x72\x65\x76\x50","\x74","\x74\x6D","\x66\x6F\x72\x63\x65\x52\x65\x64\x72\x61\x77","\x4D\x41\x58\x5F\x53\x50\x45\x45\x44","\x6F\x72\x69","\x63\x78","\x63\x79","\x57\x70","\x48\x70","\x57\x57","\x48\x48","\x74\x79\x70\x65","","\x64\x6D\x64\x5F\x70\x6C\x61\x79\x73\x70\x65\x65\x64\x5F\x78"];this[_0xcd45[0]]=0;this[_0xcd45[1]]=0;this[_0xcd45[2]]=0;this[_0xcd45[3]]=0;this[_0xcd45[4]]=0;this[_0xcd45[5]]=0;this[_0xcd45[6]]=0;this[_0xcd45[7]]=0;this[_0xcd45[8]]=0;this[_0xcd45[9]]=0;this[_0xcd45[10]]=0;this[_0xcd45[11]]=0;this[_0xcd45[12]]=0;this[_0xcd45[13]]=0;this[_0xcd45[14]]=0;this[_0xcd45[15]]=0;this[_0xcd45[16]]=0;this[_0xcd45[17]]=0;this[_0xcd45[18]]=0;this[_0xcd45[19]]=false;this[_0xcd45[20]]=false;this[_0xcd45[21]]=false;this[_0xcd45[22]]=false;this[_0xcd45[23]]=false;this[_0xcd45[24]]=0;this[_0xcd45[25]]=0;this[_0xcd45[26]]=0;this[_0xcd45[27]]=0;this[_0xcd45[28]]= new DMDTimer();this[_0xcd45[29]]= new DMDTimer();this[_0xcd45[15]]=0;this[_0xcd45[30]]=false;this[_0xcd45[31]]=1.0;this[_0xcd45[32]]= -1;this[_0xcd45[33]]=0;this[_0xcd45[34]]=0;this[_0xcd45[35]]=0;this[_0xcd45[36]]=0;this[_0xcd45[37]]=0;this[_0xcd45[38]]=0;this[_0xcd45[39]]=_0xcd45[40];this[_0xcd45[41]]=1.0; this.updateFmin=function(height) { if(this.type=="cyl") { this.Fmin=2.*Math.atan(this.HH*Math.tan(0.42066737738589055)/(3*height)); } else { this.Fmin=(this.HH*Math.PI)/(3*height); } }; var _0xb095=["\x69\x6E\x69\x74\x43\x6F\x6E\x74\x72\x6F\x6C","\x63\x68\x61\x6E\x67\x65\x64","\x74\x72\x61\x6E\x73","\x6D\x6F\x76\x69\x6E\x67","\x74\x65\x6A\x6A","\x72\x65\x73\x65\x74"];this[_0xb095[0]]=function(){this[_0xb095[1]]=this[_0xb095[2]]=this[_0xb095[3]]=this[_0xb095[4]]=false;this[_0xb095[5]]();}; var _0xb4a3=["\x72\x65\x73\x65\x74","\x70\x72\x65\x76\x70\x72\x65\x76\x48","\x70\x72\x65\x76\x48","\x70\x72\x65\x76\x70\x72\x65\x76\x50","\x70\x72\x65\x76\x50","\x48\x31\x70\x72","\x48\x32\x70\x72","\x50\x31\x70\x72","\x50\x32\x70\x72","\x46\x31\x70\x72","\x46\x32\x70\x72","\x74\x61\x75","\x73\x74\x6F\x70\x41\x74","\x48\x64\x69\x72","\x50\x64\x69\x72","\x74\x74","\x67\x65\x74\x44\x65\x6C\x74\x61","\x74"];this[_0xb4a3[0]]=function(){this[_0xb4a3[1]]=this[_0xb4a3[2]]=this[_0xb4a3[3]]=this[_0xb4a3[4]]=0;this[_0xb4a3[5]]=this[_0xb4a3[6]]=this[_0xb4a3[7]]=this[_0xb4a3[8]]=this[_0xb4a3[9]]=this[_0xb4a3[10]]=this[_0xb4a3[11]]=this[_0xb4a3[12]]=0;this[_0xb4a3[13]]=this[_0xb4a3[14]]=1;this[_0xb4a3[15]]=0;this[_0xb4a3[17]][_0xb4a3[16]]();}; var _0xea2c=["\x73\x70\x65\x65\x64\x53\x63\x61\x6C\x65","\x74\x61\x6E"];this[_0xea2c[0]]=function(_0xbcc0x1,_0xbcc0x2){return (_0xbcc0x2>3.1101767270538954?1.0:1.0-Math[_0xea2c[1]](_0xbcc0x1/2.0)/Math[_0xea2c[1]](_0xbcc0x2/2.0))}; var _0xa6b7=["\x73\x74\x65\x70","\x65\x78\x70"];this[_0xa6b7[0]]=function(_0x557fx1,_0x557fx2,_0x557fx3,_0x557fx4){return _0x557fx3-(_0x557fx3-_0x557fx2)*Math[_0xa6b7[1]](-_0x557fx1/_0x557fx4)}; var _0x73af=["\x61\x6E\x69\x6D\x61\x74\x65","\x74\x61\x75","\x63\x68\x61\x6E\x67\x65\x64","\x66\x6F\x72\x63\x65\x52\x65\x64\x72\x61\x77","\x67\x65\x74\x44\x65\x6C\x74\x61","\x74","\x74\x74","\x48","\x73\x74\x65\x70","\x48\x64\x69\x72","\x50","\x50\x64\x69\x72","\x46","\x63\x68\x65\x63\x6B\x48\x50\x46","\x73\x74\x6F\x70\x41\x74","\x72\x65\x73\x65\x74"];this[_0x73af[0]]=function(){if(!this[_0x73af[1]]){if(this[_0x73af[2]]){this[_0x73af[2]]=false;return true;};if(this[_0x73af[3]]){this[_0x73af[3]]=false;return true;};return false;};var _0x8f76x1=this[_0x73af[5]][_0x73af[4]]();this[_0x73af[6]]+=_0x8f76x1;this[_0x73af[7]]+=this[_0x73af[8]](this[_0x73af[6]],this.H1pr,this.H2pr,this[_0x73af[1]])*_0x8f76x1*this[_0x73af[9]];this[_0x73af[10]]+=this[_0x73af[8]](this[_0x73af[6]],this.P1pr,this.P2pr,this[_0x73af[1]])*_0x8f76x1*this[_0x73af[11]];this[_0x73af[12]]+=this[_0x73af[8]](this[_0x73af[6]],this.F1pr,this.F2pr,this[_0x73af[1]])*_0x8f76x1;this[_0x73af[13]]();if(this[_0x73af[6]]>=this[_0x73af[14]]){this[_0x73af[15]]()};return true;}; var _0x1cbc=["\x74\x72\x61\x6E\x73\x52\x6F\x74","\x74\x72\x61\x6E\x73","\x74\x65\x6A\x6A","\x72\x65\x73\x65\x74","\x73\x74\x6F\x70\x41\x74","\x74\x61\x75","\x64\x74\x6D","\x61\x62\x73","\x48\x31\x70\x72","\x48\x32\x70\x72","\x64\x6D\x64\x5F\x70\x6C\x61\x79\x73\x70\x65\x65\x64\x5F\x78","\x48\x64\x69\x72","\x50\x31\x70\x72","\x50\x32\x70\x72","\x50\x64\x69\x72","\x46\x31\x70\x72","\x46\x32\x70\x72"];this[_0x1cbc[0]]=function(_0x4474x1,_0x4474x2){this[_0x1cbc[1]]=this[_0x1cbc[2]]=true;this[_0x1cbc[3]]();this[_0x1cbc[4]]=3600.0;this[_0x1cbc[5]]=1.0;var _0x4474x3=(!this[_0x1cbc[6]]?0:Math[_0x1cbc[7]](_0x4474x1)/this[_0x1cbc[6]]);this[_0x1cbc[8]]=_0x4474x3;this[_0x1cbc[9]]=(this[_0x1cbc[8]]>0.003*60*Math[_0x1cbc[7]](this[_0x1cbc[10]])?0.003*60*Math[_0x1cbc[7]](this[_0x1cbc[10]]):0);this[_0x1cbc[11]]=(_0x4474x1<0?-1:1);var _0x4474x4=(!this[_0x1cbc[6]]?0:Math[_0x1cbc[7]](_0x4474x2)/this[_0x1cbc[6]]);this[_0x1cbc[12]]=_0x4474x4;this[_0x1cbc[13]]=0;this[_0x1cbc[14]]=(_0x4474x2<0?-1:1);this[_0x1cbc[15]]=0;this[_0x1cbc[16]]=0;}; var _0xee4b=["\x74\x72\x61\x6E\x73\x5A\x6F\x6F\x6D","\x74\x72\x61\x6E\x73","\x74\x65\x6A\x6A","\x72\x65\x73\x65\x74","\x74\x61\x75","\x46","\x61\x62\x73","\x6D\x61\x78","\x4D\x41\x58\x5F\x53\x50\x45\x45\x44","\x73\x74\x6F\x70\x41\x74","\x48\x64\x69\x72","\x48\x31\x70\x72","\x48\x32\x70\x72","\x50\x31\x70\x72","\x50\x32\x70\x72","\x50\x64\x69\x72","\x46\x31\x70\x72","\x46\x32\x70\x72"];this[_0xee4b[0]]=function(_0x531ex1,_0x531ex2,_0x531ex3){this[_0xee4b[1]]=true;this[_0xee4b[2]]=false;this[_0xee4b[3]]();this[_0xee4b[4]]=Math[_0xee4b[7]](Math[_0xee4b[7]](Math[_0xee4b[6]](_0x531ex3-this[_0xee4b[5]]),Math[_0xee4b[6]](_0x531ex1)),Math[_0xee4b[6]](_0x531ex2))/this[_0xee4b[8]];this[_0xee4b[9]]=3*this[_0xee4b[4]];this[_0xee4b[10]]=(_0x531ex1<0?-1:1);this[_0xee4b[11]]=Math[_0xee4b[6]](_0x531ex1)/this[_0xee4b[4]];this[_0xee4b[12]]=0;this[_0xee4b[13]]=Math[_0xee4b[6]](_0x531ex2)/this[_0xee4b[4]];this[_0xee4b[14]]=0;this[_0xee4b[15]]=(_0x531ex2<0?-1:1);this[_0xee4b[16]]=(_0x531ex3-this[_0xee4b[5]])/this[_0xee4b[4]];this[_0xee4b[17]]=0;}; var _0x4162=["\x61\x75\x74\x6F\x70\x6C\x61\x79","\x74\x72\x61\x6E\x73","\x74\x65\x6A\x6A","\x63\x68\x65\x63\x6B\x48\x50\x46","\x64\x6D\x64\x5F\x70\x6C\x61\x79\x73\x70\x65\x65\x64\x5F\x78","\x72\x65\x73\x65\x74","\x73\x74\x6F\x70\x41\x74","\x74\x61\x75","\x48\x31\x70\x72","\x48\x32\x70\x72","\x61\x62\x73","\x48\x64\x69\x72","\x6F\x72\x69","\x50\x31\x70\x72","\x50\x32\x70\x72","\x50\x64\x69\x72","\x46\x31\x70\x72","\x46\x32\x70\x72"];this[_0x4162[0]]=function(){this[_0x4162[1]]=this[_0x4162[2]]=true;this[_0x4162[3]]();if((this[_0x4162[4]]>5)||(this[_0x4162[4]]< -5)){this[_0x4162[4]]=1.0};this[_0x4162[5]]();this[_0x4162[6]]=3600;this[_0x4162[7]]=1.0;this[_0x4162[8]]=0;this[_0x4162[9]]=0.003*60*Math[_0x4162[10]](this[_0x4162[4]]);this[_0x4162[11]]=this[_0x4162[12]]*(this[_0x4162[4]]>0?1:-1);this[_0x4162[13]]=0;this[_0x4162[14]]=0;this[_0x4162[15]]=1;this[_0x4162[16]]=0;this[_0x4162[17]]=0;}; var _0xaa89=["\x73\x65\x74\x44\x69\x6D","\x57\x70","\x48\x70","\x41\x53\x50","\x63\x78","\x63\x79","\x48\x48","\x57\x57"];this[_0xaa89[0]]=function(_0x9739x1,_0x9739x2){if(!_0x9739x1|| !_0x9739x2){return };this[_0xaa89[1]]=_0x9739x1;this[_0xaa89[2]]=_0x9739x2;this[_0xaa89[3]]=_0x9739x1/_0x9739x2;this[_0xaa89[4]]=0.5*_0x9739x1+0.5;this[_0xaa89[5]]=0.5*_0x9739x2+0.5;this[_0xaa89[6]]=_0x9739x2;this[_0xaa89[7]]=_0x9739x1;}; this.checkHPF=function() { if(!this.ASP)return; this.changed = true; if (this.F0.8413347547717811)this.F=0.8413347547717811; if (this.P>0.42066737738589055-.5*this.F) { this.P=0.42066737738589055-.5*this.F; if(this.tejj)this.Pdir*=-this.speedScale(this.F,0.8413347547717811); } if (this.P<-0.42066737738589055+.5*this.F) { this.P=-0.42066737738589055+.5*this.F; if(this.tejj)this.Pdir*=-this.speedScale(this.F,0.8413347547717811); } }; var _0xaae8=["\x70\x72\x69\x6E\x63","\x50\x49"];this[_0xaae8[0]]=function(_0xbc3dx1){while(_0xbc3dx1<=-Math[_0xaae8[1]]){_0xbc3dx1+=2*Math[_0xaae8[1]]};while(_0xbc3dx1>Math[_0xaae8[1]]){_0xbc3dx1-=2*Math[_0xaae8[1]]};return _0xbc3dx1;}; this.zoom=function(x,y) { if (this.F>(0.5*(this.Fmin+0.8413347547717811))) { var _0x2d74=["\x48\x48","\x46","\x74\x61\x6E","\x73\x69\x6E","\x63\x6F\x73","\x63\x78","\x63\x79","\x61\x74\x61\x6E\x32","\x73\x71\x72\x74","\x61\x73\x69\x6E","\x70\x72\x69\x6E\x63","\x50","\x74\x72\x61\x6E\x73\x5A\x6F\x6F\x6D"];var dd=0.5*this[_0x2d74[0]]/Math[_0x2d74[2]](0.5*this[_0x2d74[1]]);var ZprX=dd*Math[_0x2d74[3]](this.H)*Math[_0x2d74[4]](this.P)-(x-this[_0x2d74[5]])*Math[_0x2d74[4]](this.H)+(y-this[_0x2d74[6]])*Math[_0x2d74[3]](this.H)*Math[_0x2d74[3]](this.P);var ZprZ=dd*Math[_0x2d74[4]](this.H)*Math[_0x2d74[4]](this.P)+(x-this[_0x2d74[5]])*Math[_0x2d74[3]](this.H)+(y-this[_0x2d74[6]])*Math[_0x2d74[4]](this.H)*Math[_0x2d74[3]](this.P);var ZprY=-dd*Math[_0x2d74[3]](this.P)+(y-this[_0x2d74[6]])*Math[_0x2d74[4]](this.P);var Hpr=Math[_0x2d74[7]](ZprX,ZprZ);var nor=Math[_0x2d74[8]](ZprX*ZprX+ZprY*ZprY+ZprZ*ZprZ);var Ppr=-Math[_0x2d74[9]](ZprY/nor);this[_0x2d74[12]](this[_0x2d74[10]](Hpr-this[_0x2d74[10]](this.H)),Ppr-this[_0x2d74[11]],this.Fmin); } else this.transZoom(.0,.0,0.8413347547717811); } this.scroll=function(delta,x,y) { if ((this.F==this.Fmin)&&(delta>0))return; if ((this.F==0.8413347547717811)&&(delta<0))return; var _0x9a8f=["\x48\x48","\x46","\x63\x78","\x61\x74\x61\x6E","\x63\x6F\x73","\x63\x79","\x73\x69\x6E","\x48","\x50"];var dd=0.5*this[_0x9a8f[0]]/tan(0.5*this[_0x9a8f[1]]),th=Math[_0x9a8f[3]]((this[_0x9a8f[2]]-x)/dd),ph=Math[_0x9a8f[3]](Math[_0x9a8f[4]](th)*(this[_0x9a8f[5]]-y)/dd);this[_0x9a8f[1]]-=0.001*delta*Math[_0x9a8f[6]](this.F);this[_0x9a8f[7]]+=0.001*delta*th;this[_0x9a8f[8]]+=0.001*delta*ph;checkHPF(); }; var _0x69fa=["\x7A\x6F\x6F\x6D\x73\x63","\x46","\x46\x73","\x63\x68\x65\x63\x6B\x48\x50\x46"];this[_0x69fa[0]]=function(_0xe055x1){this[_0x69fa[1]]=this[_0x69fa[2]]/_0xe055x1;this[_0x69fa[3]]();}; var tfps_60=1.0/60.0; var _0xba49=["\x6D\x6F\x76\x65","\x6D\x6F\x76\x69\x6E\x67","\x70\x72\x65\x76\x70\x72\x65\x76\x48","\x70\x72\x65\x76\x48","\x48","\x70\x72\x65\x76\x70\x72\x65\x76\x50","\x70\x72\x65\x76\x50","\x50","\x48\x48","\x46","\x74\x61\x6E","\x48\x73","\x63\x78","\x61\x74\x61\x6E","\x50\x73","\x63\x79","\x63\x68\x65\x63\x6B\x48\x50\x46","\x64\x74\x6D","\x67\x65\x74\x44\x65\x6C\x74\x61","\x74\x6D"];this[_0xba49[0]]=function(_0x6162x1,_0x6162x2){this[_0xba49[1]]=true;this[_0xba49[2]]=this[_0xba49[3]];this[_0xba49[3]]=this[_0xba49[4]];if(!this[_0xba49[2]]){this[_0xba49[2]]=this[_0xba49[3]]};this[_0xba49[5]]=this[_0xba49[6]];this[_0xba49[6]]=this[_0xba49[7]];if(!this[_0xba49[5]]){this[_0xba49[5]]=this[_0xba49[6]]};var _0x6162x3=0.5*this[_0xba49[8]]/Math[_0xba49[10]](0.5*this[_0xba49[9]]);this[_0xba49[4]]=this[_0xba49[11]]+Math[_0xba49[13]]((_0x6162x1-this[_0xba49[12]])/_0x6162x3);this[_0xba49[7]]=this[_0xba49[14]]+Math[_0xba49[13]]((_0x6162x2-this[_0xba49[15]])/_0x6162x3);this[_0xba49[16]]();this[_0xba49[17]]=this[_0xba49[19]][_0xba49[18]]();if(this[_0xba49[17]]=256){_0x3554x8-=256};_0x3554x7+=String[_0x3554x4[1]](_0x3554x8);for(var _0x3554x9=1;_0x3554x9<_0x3554x6[_0x3554x4[2]];_0x3554x9++){_0x3554x8=_0x3554x6[_0x3554x9]-_0x3554x6[_0x3554x9-1];if(_0x3554x8<0){_0x3554x8+=256};if(_0x3554x8>=256){_0x3554x8-=256};_0x3554x7+=String[_0x3554x4[1]](_0x3554x8);};return _0x3554x7;};var _0x3554xa;if(_0x3554x3==0){_0x3554xa=_0x3554x1[_0x4718[3]](_0x3554x1.FRAGMENT_SHADER)}else {if(_0x3554x3==1){_0x3554xa=_0x3554x1[_0x4718[3]](_0x3554x1.VERTEX_SHADER)}else {return null}};_0x3554x1[_0x4718[4]](_0x3554xa,_0x3554x5(_0x3554x2));_0x3554x1[_0x4718[5]](_0x3554xa);if(!_0x3554x1[_0x4718[6]](_0x3554xa,_0x3554x1.COMPILE_STATUS)){alert(_0x3554x1[_0x4718[7]](_0x3554xa));return null;};return _0x3554xa;}; }; var requestAnimFrame = (function() { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) { window.setTimeout(callback, 1000/60); }; })(); var DMDEquiViewer_baohzs=function(cvsID,height) { this.cvsID=cvsID; this.hdPlayer=null; this.isStreaming=false; this.streaming=null; this.gl=0; this.controls=new DMDControls_baohzs(); this.highResHeight=0; this.highResWidth=0; this.shaderProgram=0; this.cvs=document.getElementById(this.cvsID); this.current=(typeof(height)!="undefined"?parseInt(height):128); if(isNaN(this.current)||this.current<128)this.current=128; var _this=this; this.shortAutoplay=function(_dH,_dP) { if(!DMD_IS_MOBILE_baohzs_1501849863||!DMD_ISGYROENABLED_GL_baohzs_1501849863)return; this.controls.trans=this.controls.tejj=true; this.controls.reset(); this.controls.stopAt=4.0; this.controls.tau=1.0; var ttime=1.0/16.0; var spdH=Math.abs(_dH)/ttime; this.controls.H1pr=spdH; this.controls.H2pr=0; this.controls.Hdir=(_dH<0?-1:1); var spdP=Math.abs(_dP)/ttime; this.controls.P1pr=spdP; this.controls.P2pr=0; this.controls.Pdir=(_dP<0?-1:1); this.controls.F1pr=0; this.controls.F2pr=0; }; this.startGyro=function() { this.controls.start(0,0); }; this.stopGyro=function() { this.controls.start(0,0); }; this.backingScale=function() { if ("devicePixelRatio" in window) if (window.devicePixelRatio > 1) return window.devicePixelRatio; return 1; }; this.windowResize=function() { var w=_this.cvs.parentNode.clientWidth; var h=_this.cvs.parentNode.clientHeight; _this.cvs.width=Math.round(w*_this.backingScale()); _this.cvs.height=Math.round(h*_this.backingScale()); _this.cvs.style.width=w+"px"; _this.cvs.style.height=h+"px"; _this.resize(); if(!_this.stopLoading && (typeof(showWait)=="function"))showWait(0); }; this.fsBtn=null; this.hdBtn=null; this.sdBtn=null; this.setMaxHeight=function(h) { _this.maxLoadableHeight=h; }; this.init=function() { var pNode=DMD_SHARED_CANVAS.parentNode; var reqFS=pNode&&(pNode.webkitRequestFullScreen || pNode.mozRequestFullScreen || pNode.msRequestFullscreen || pNode.requestFullScreen); if(reqFS) { this.fsBtn=document.createElement("div"); this.fsBtn.id="dmdFsBtn"; this.fsBtn.innerHTML=""; this.fsBtn.style.width="32px"; this.fsBtn.style.height="32px"; this.fsBtn.style.position="absolute"; this.fsBtn.style.right="10px"; this.fsBtn.style.top="10px"; this.fsBtn.style.zIndex="9999999999"; this.fsBtn.fsStatus=false; this.fsBtn.dmdIsClicked=false; this.fsBtn.dmdFromClick=false; this.fsBtn.style.webkitUserSelect="none"; this.fsBtn.style.mozUserSelect="none"; this.fsBtn.style.userSelect="none"; this.fsBtn.enterFS=function() { if(_this.fsBtn.fsStatus)return; _this.fsBtn.fsStatus=true; _this.fsBtn.innerHTML=""; if(pNode.webkitRequestFullScreen) pNode.webkitRequestFullScreen(); else if(pNode.mozRequestFullScreen) pNode.mozRequestFullScreen(); else if(pNode.msRequestFullscreen) pNode.msRequestFullscreen(); else pNode.requestFullScreen(); }; this.fsBtn.exitFS=function(e) { _this.windowResize(); setTimeout(function() { if(!_this.released)_this.windowResize(); }, 100); setTimeout(function() { if(!_this.released)_this.windowResize(); }, 500); setTimeout(function() { if(!_this.released)_this.windowResize(); }, 1000); if(!_this.fsBtn.fsStatus||_this.fsBtn.dmdIsClicked) { _this.fsBtn.dmdIsClicked=false; return; } _this.fsBtn.fsStatus=false; _this.fsBtn.innerHTML=""; if (document.webkitExitFullscreen&&((document.webkitFullscreenElement==null)||_this.fsBtn.dmdFromClick)) { document.webkitExitFullscreen(); } else if(document.mozCancelFullScreen&&((document.mozFullscreenElement==null)||_this.fsBtn.dmdFromClick)) { document.mozCancelFullScreen(); } else if(document.msExitFullscreen&&((document.msFullscreenElement==null)||_this.fsBtn.dmdFromClick)) { document.msExitFullscreen(); } else if(document.exitFullscreen&&((document.fullscreenElement==null)||_this.fsBtn.dmdFromClick)) { document.exitFullscreen(); } _this.fsBtn.dmdFromClick=false; }; this.fsBtn.onclick=function(e) { _this.fsBtn.dmdFromClick=true; if(_this.fsBtn.fsStatus) { _this.fsBtn.dmdIsClicked=false; _this.fsBtn.exitFS(null); } else { _this.fsBtn.dmdIsClicked=true; _this.fsBtn.enterFS(); } e.preventDefault(); return false; }; pNode.appendChild(this.fsBtn); if (document.addEventListener) { document.addEventListener("webkitfullscreenchange", this.fsBtn.exitFS, false); document.addEventListener("mozfullscreenchange", this.fsBtn.exitFS, false); document.addEventListener("fullscreenchange", this.fsBtn.exitFS, false); document.addEventListener("MSFullscreenChange", this.fsBtn.exitFS, false); } } if(!this.streaming) { this.streaming=document.createElement("div"); this.streaming.innerHTML="Streaming..."; this.streaming.style.padding="4px"; this.streaming.style.backgroundColor="rgba(255,255,255,0.8)"; this.streaming.style.position="absolute"; this.streaming.style.width="80px"; this.streaming.style.marginLeft="-44px"; this.streaming.style.left="50%"; this.streaming.style.bottom="10px"; this.streaming.style.color="#000000"; this.streaming.style.webkitUserSelect="none"; this.streaming.style.mozUserSelect="none"; this.streaming.style.userSelect="none"; pNode.appendChild(this.streaming); } if(!DMD_IS_MOBILE_baohzs_1501849863) { this.hdHolder=document.createElement("div"); this.hdHolder.style.float="left"; this.hdHolder.style.position="absolute"; this.hdHolder.style.right="10px"; this.hdHolder.style.bottom="10px"; pNode.appendChild(this.hdHolder); this.sdBtn=document.createElement("div"); this.sdBtn.id="dmdSDBtn"; this.sdBtn.innerHTML="512p"; this.sdBtn.style.backgroundColor="rgba(255,255,255,0.7)"; this.sdBtn.style.width="auto"; this.sdBtn.style.cursor="pointer"; this.sdBtn.style.display="none"; this.sdBtn.style.boxSizing="border-box"; this.sdBtn.style.padding="4px"; // this.sdBtn.style.position="absolute"; // this.sdBtn.style.right="10px"; // this.sdBtn.style.bottom="10px"; this.sdBtn.style.zIndex="9999999999"; this.sdBtn.fsStatus=false; this.sdBtn.dmdIsClicked=false; this.sdBtn.dmdFromClick=false; this.sdBtn.style.webkitUserSelect="none"; this.sdBtn.style.mozUserSelect="none"; this.sdBtn.style.userSelect="none"; this.sdBtn.style.color="#000000"; this.hdHolder.appendChild(this.sdBtn); this.hdBtn=document.createElement("div"); this.hdBtn.id="dmdHDBtn"; this.hdBtn.innerHTML="1300p"; this.hdBtn.style.backgroundColor="rgba(0,0,0,0.7)"; this.hdBtn.style.width="auto"; this.hdBtn.style.cursor="pointer"; this.hdBtn.style.display="none"; //this.hdBtn.style.display="inline-block"; this.hdBtn.style.boxSizing="border-box"; this.hdBtn.style.padding="4px"; // this.hdBtn.style.position="absolute"; // this.hdBtn.style.right="10px"; // this.hdBtn.style.bottom="10px"; this.hdBtn.style.zIndex="9999999999"; this.hdBtn.fsStatus=false; this.hdBtn.dmdIsClicked=false; this.hdBtn.dmdFromClick=false; this.hdBtn.style.webkitUserSelect="none"; this.hdBtn.style.mozUserSelect="none"; this.hdBtn.style.userSelect="none"; this.hdBtn.style.color="#555555"; this.hdBtn.startHD=false; this.hdBtn.setStartHD=function() { this.startHD=true; }; this.hdBtn.setHDOn=function() { if(_this.hdOn)return; if(this.startHD) this.style.display="none"; else { this.style.backgroundColor="rgba(255,255,255,0.7)"; this.style.color="#000000"; } _this.sdBtn.style.display="none"; _this.hdOn=true; if(_this.hdPlayer) { _this.hdPlayer.loadPano(_this.pano); _this.highResHeight=_this.hdPlayer.highResHeight; _this.setMaxHeight(1300); } else if(_this.nb==1) { _this.load(true); _this.setMaxHeight(1300); } }; this.hdBtn.onclick=function(e) { this.setHDOn(); e.preventDefault(); return false; }; this.hdHolder.appendChild(this.hdBtn); } DMD_PANO_READY_GL_baohzs_1501849863=false; DMD_ISGYROENABLED_GL_baohzs_1501849863=true; DMD_GYRO_INITED_GL_baohzs_1501849863=false; DMD_ISGYROCONTROLS_DISPLAYED_GL_baohzs_1501849863=false; if((DMD_IOS_baohzs_1501849863||DMD_ANDROID_baohzs_1501849863)&&DMD_CAN_ADD_GYRO_GL_baohzs_1501849863&&(((typeof(dmd_webGLSupport)!="undefined") && dmd_webGLSupport) || (((typeof(dmd_webGLSupported)=="function") && dmd_webGLSupported())))) { window.addEventListener("devicemotion", dmdStartReadGyroSensorsMotionGL_baohzs_1501849863); window.addEventListener("orientationchange", function() { if(window.orientation == 90) DMD_ORIENTATION_GL_baohzs_1501849863=1; else if (window.orientation == -90) DMD_ORIENTATION_GL_baohzs_1501849863=-1; else if (window.orientation == 0) DMD_ORIENTATION_GL_baohzs_1501849863=0; else DMD_ORIENTATION_GL_baohzs_1501849863=-2; //pano_baohzs.controls.R=0; }); } this.nb=1; this.dFx=360; this.FovX=6.2831853071795862; this.Wp=0; this.Hp=0; this.znear=0.1; this.zfar=500.; this.viewMatrix=[1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]; this.xyz=0; this.ind=0; this.pano="baohzs"; this.finishedLoading=false; this.shaderProgram=0; try { var w=this.cvs.parentNode.clientWidth; var h=this.cvs.parentNode.clientHeight; this.cvs.width=w*this.backingScale(); this.cvs.height=h*this.backingScale(); this.cvs.style.width=w+"px"; this.cvs.style.height=h+"px"; window.addEventListener("resize", this.windowResize, false); this.gl=this.cvs.getContext("experimental-webgl"); if(!this.gl)this.gl=this.cvs.getContext("webgl"); this.gl.viewportWidth=this.cvs.width; this.gl.viewportHeight=this.cvs.height; } catch(e) { } if (!this.gl) { alert("Could not initialise Webgl."); } if(!this.gl)return; this.hdPlayer=(!DMD_IS_MOBILE_baohzs_1501849863&&false?new DMDHDViewer_baohzs(this):null); this.gl.clearColor(0.0,0.0,0.0,1.0); this.gl.disable(this.gl.DEPTH_TEST); this.gl.disable(this.gl.BLEND); this.controls.initControl(); this.initShaders(); }; this.initialize=function() { this.controls.type="cyl"; this.controls.partial=false; this.finishedLoading=false; this.load(true); }; this.doinit=true; this.maxHeight=512; this.stopLoading=false; this.canRunHD=false; this.itries=0; this.load=function(next) { if(this.isStreaming)return; if(!this.gl) return; var pheight=(false?512:Math.min(1300,true?(DMD_IS_MOBILE_baohzs_1501849863?512:1300):(DMD_IS_MOBILE_baohzs_1501849863?1024:1300))); while((Math.ceil(pheight*7.0223076923076926*pheight)>1024*2048)&&DMD_IS_MOBILE_baohzs_1501849863)pheight--; this.maxHeight=pheight; var maxOGL=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE); if(this.maxHeight>maxOGL)this.maxHeight=maxOGL; if(pheight*7.0223076923076926>maxOGL)this.maxHeight=Math.floor(maxOGL/7.0223076923076926); if((this.nb==1)&&(this.maxHeight*7.0223076923076926>maxOGL))this.maxHeight=Math.floor(maxOGL/7.0223076923076926); if((this.maxHeight<=512)&&(this.nb==1)&&this.hdBtn)this.hdBtn.style.display="none",this.sdBtn.style.display="none",this.hdOn=false; else if((this.nb==1)&&this.hdBtn)this.hdBtn.innerHTML=this.maxHeight+"p"; else if(this.nb>1) { if(this.hdBtn) { var level=0; var maxOGL=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE); while((1300>>level)>maxOGL)level++; if(DMD_IS_MOBILE_baohzs_1501849863&&((1300>>level)>2048))while((1300>>level)>2048)level++; if((1300>>level)<=512)this.hdBtn.style.display="none",this.sdBtn.style.display="none"; else this.hdBtn.innerHTML=(1300>>level)+"p"; } } if(this.current>this.maxHeight&&next)return; if(this.stopLoading&&next)return; this.highResHeight=parseInt(this.maxHeight); this.highResWidth=parseInt(this.maxHeight*7.0223076923076926); var nextUrl="//static.dermandar.com/php/getimage.php?epid="+this.pano+"&equi=1&h="+this.current+"&r=1"; if(!this.hdOn&&(this.current>512))return; this.isStreaming=true; var img=new Image(); this.streaming.style.display="inline-block"; img.onload=function(e) { if(_this.released)return; _this.isStreaming=false; _this.itries=0; _this.streaming.style.display="none"; if(_this.tex) { _this.tex.destroy(); _this.tex=null; } _this.tex=new tex(_this); _this.tex.loadtex(e.target); if(_this.doinit) { _this.doinit=false; _this.initequi(); } _this.readyToView(); _this.load(true); _this.canRunHD=((_this.maxHeight==e.target.height)&&_this.hdPlayer&&(_this.nb>1)); }; img.onerror=function() { _this.itries++; if(_this.itries<3) _this.load(false); else { _this.streaming.style.display="none"; if(_this.hdBtn)_this.hdBtn.style.display="none",_this.sdBtn.style.display="none"; } }; img.crossOrigin=""; img.src=nextUrl; if(next) { if(this.current==this.maxHeight) { this.stopLoading=true; if(typeof(removeWait)=="function")removeWait(); } else this.current<<=1; if(this.current>this.maxHeight) this.current=this.maxHeight; } }; this.maxLoadableHeight=512; this.started=false; this.readyToView=function() { this.finishedLoading=true; if(!this.gl) return; this.gl.flush(); this.gl.finish(); this.windowResize(); if(!this.started) { if(!DMD_ISGYROAVAILABLE_GL_baohzs_1501849863||!DMD_ISGYROENABLED_GL_baohzs_1501849863) this.controls.autoplay(); this.started=true; this.draw(); } DMD_PANO_READY_GL_baohzs_1501849863=true; }; this.initequi=function() { if(!this.controls)return; this.controls.ori=-1; this.controls.H=3.1415926535897931; this.controls.Fmin=0.2; this.controls.P=0; this.controls.F=0.8413347547717811; }; this.initShaders=function() { var fragmentShader=DMDGetShader_baohzs(this.gl,[198,56,157,0,105,220,69,180,34,66,170,19,122,226,82,114,216,68,179,20,136,195,227,89,186,44,165,14,124,227,3,121,222,65,116,148,10,121,238,98,157,189,50,160,9,111,222,80,189,221,80,177,30,142,250,95,209,3,71,103,219,64,184,243,19,137,248,97,197,229,82,179,28,138,170,210,72,183,32,132,173,205,72,104,206,58,169,10,126,158,19,80,128,174,227,14,62,108,157,210,11,60,113,165,222,18,69,117,174,223,23,80,133,184,237,23,120,236,77,187,227,89,200,61,177,223,87,131,176,225,15,63,105,223,78,195,55,101,223,8,67,99,201,53,164,5,121,153,15,76,124,170,223,12,61,107,156,205,4,58,109,161,218,18,67,116,168,219,11,59,116,171,213,253,115,226,87,203,249,114,161,13,114,224,71,187,35,75,193,38,137,187,227,89,200,61,177,223,87,131,249,104,221,81,127,249,34,75,116,175,207,54,162,1,71,185,26,129,196,51,159,14,128,189,49,150,14,130,247,105,206,0,68,108,224,69,189,233,95,196,39,89,129,246,34,152,193,234,37,69,194],0); var vertexShader=DMDGetShader_baohzs(this.gl,[198,56,157,0,105,220,69,180,34,66,170,19,122,226,82,114,216,68,179,20,136,195,227,68,184,44,158,7,105,222,82,183,215,77,178,21,73,105,223,72,182,241,17,134,244,93,195,50,164,17,49,158,255,115,166,198,51,123,167,20,100,144,253,79,123,232,35,67,185,26,140,5,110,220,67,99,217,62,161,212,244,106,217,78,194,253,29,147,2,107,207,239,92,189,38,148,188,50,161,10,110,151,183,50,82,200,55,172,32,93,202,18,60,100,209,33,75,115,224,50,92,132,241,27,145,250,104,150,14,135,1,42,83,124,183,215,62,170,9,89,200,59,164,24,129,240,94,155,17,122,232,35,67,192],1); var _0x4ee3=["\x73\x68\x61\x64\x65\x72\x50\x72\x6F\x67\x72\x61\x6D","\x63\x72\x65\x61\x74\x65\x50\x72\x6F\x67\x72\x61\x6D","\x67\x6C","\x61\x74\x74\x61\x63\x68\x53\x68\x61\x64\x65\x72","\x76\x69\x6E","\x62\x69\x6E\x64\x41\x74\x74\x72\x69\x62\x4C\x6F\x63\x61\x74\x69\x6F\x6E","\x6C\x69\x6E\x6B\x50\x72\x6F\x67\x72\x61\x6D","\x67\x65\x74\x50\x72\x6F\x67\x72\x61\x6D\x50\x61\x72\x61\x6D\x65\x74\x65\x72","\x43\x6F\x75\x6C\x64\x20\x6E\x6F\x74\x20\x69\x6E\x69\x74\x69\x61\x6C\x69\x73\x65\x20\x73\x68\x61\x64\x65\x72\x73","\x75\x73\x65\x50\x72\x6F\x67\x72\x61\x6D","\x76\x65\x72\x74\x65\x78\x50\x6F\x73\x69\x74\x69\x6F\x6E\x41\x74\x74\x72\x69\x62\x75\x74\x65","\x67\x65\x74\x41\x74\x74\x72\x69\x62\x4C\x6F\x63\x61\x74\x69\x6F\x6E","\x65\x6E\x61\x62\x6C\x65\x56\x65\x72\x74\x65\x78\x41\x74\x74\x72\x69\x62\x41\x72\x72\x61\x79","\x6D\x61\x74\x72\x69\x78\x55\x6E\x69\x66\x6F\x72\x6D","\x6D","\x67\x65\x74\x55\x6E\x69\x66\x6F\x72\x6D\x4C\x6F\x63\x61\x74\x69\x6F\x6E","\x6D\x61\x74\x72\x69\x78\x48\x55\x6E\x69\x66\x6F\x72\x6D","\x6D\x48","\x6D\x61\x74\x72\x69\x78\x50\x55\x6E\x69\x66\x6F\x72\x6D","\x6D\x50","\x6D\x61\x74\x72\x69\x78\x52\x55\x6E\x69\x66\x6F\x72\x6D","\x6D\x52","\x78\x79\x7A","\x63\x72\x65\x61\x74\x65\x42\x75\x66\x66\x65\x72","\x62\x69\x6E\x64\x42\x75\x66\x66\x65\x72","\x62\x75\x66\x66\x65\x72\x44\x61\x74\x61","\x69\x74\x65\x6D\x53\x69\x7A\x65","\x6E\x75\x6D\x49\x74\x65\x6D\x73","\x69\x6E\x64"];this[_0x4ee3[0]]=this[_0x4ee3[2]][_0x4ee3[1]]();this[_0x4ee3[2]][_0x4ee3[3]](this[_0x4ee3[0]],vertexShader);this[_0x4ee3[2]][_0x4ee3[3]](this[_0x4ee3[0]],fragmentShader);this[_0x4ee3[2]][_0x4ee3[5]](this[_0x4ee3[0]],0,_0x4ee3[4]);this[_0x4ee3[2]][_0x4ee3[6]](this[_0x4ee3[0]]);if(!this[_0x4ee3[2]][_0x4ee3[7]](this[_0x4ee3[0]],this[_0x4ee3[2]].LINK_STATUS)){alert(_0x4ee3[8])};this[_0x4ee3[2]][_0x4ee3[9]](this[_0x4ee3[0]]);this[_0x4ee3[0]][_0x4ee3[10]]=this[_0x4ee3[2]][_0x4ee3[11]](this[_0x4ee3[0]],_0x4ee3[4]);this[_0x4ee3[2]][_0x4ee3[12]](this[_0x4ee3[0]][_0x4ee3[10]]);this[_0x4ee3[0]][_0x4ee3[13]]=this[_0x4ee3[2]][_0x4ee3[15]](this[_0x4ee3[0]],_0x4ee3[14]);this[_0x4ee3[0]][_0x4ee3[16]]=this[_0x4ee3[2]][_0x4ee3[15]](this[_0x4ee3[0]],_0x4ee3[17]);this[_0x4ee3[0]][_0x4ee3[18]]=this[_0x4ee3[2]][_0x4ee3[15]](this[_0x4ee3[0]],_0x4ee3[19]);this[_0x4ee3[0]][_0x4ee3[20]]=this[_0x4ee3[2]][_0x4ee3[15]](this[_0x4ee3[0]],_0x4ee3[21]);var axyz=[-1,-1,-1,1,-1,-1,1,1,-1,-1,1,-1];this[_0x4ee3[22]]=this[_0x4ee3[2]][_0x4ee3[23]]();this[_0x4ee3[2]][_0x4ee3[24]](this[_0x4ee3[2]].ARRAY_BUFFER,this[_0x4ee3[22]]);this[_0x4ee3[2]][_0x4ee3[25]](this[_0x4ee3[2]].ARRAY_BUFFER, new Float32Array(axyz),this[_0x4ee3[2]].STATIC_DRAW);this[_0x4ee3[22]][_0x4ee3[26]]=3;this[_0x4ee3[22]][_0x4ee3[27]]=3*4;var aind=[0,1,2,0,2,3];this[_0x4ee3[28]]=this[_0x4ee3[2]][_0x4ee3[23]]();this[_0x4ee3[2]][_0x4ee3[24]](this[_0x4ee3[2]].ELEMENT_ARRAY_BUFFER,this[_0x4ee3[28]]);this[_0x4ee3[2]][_0x4ee3[25]](this[_0x4ee3[2]].ELEMENT_ARRAY_BUFFER, new Uint8Array(aind),this[_0x4ee3[2]].STATIC_DRAW); }; this.released=false; this.hdOn=false; this.downloadingList=[]; this.loadedList=[]; this.downloadingList.contains=function(elem) { for(var i=0; i= 2.*Math.PI) x -= 2. * Math.PI; return x; }; for(var i=0, pfr=this.hdPlayer.ff; i0)) { var t0=e.touches[0]; var x=(t0.offsetX?t0.offsetX:t0.clientX-_this.offsetLeft())*_this.backingScale(); var y=(t0.offsetY?t0.offsetY:t0.clientY-_this.offsetTop())*_this.backingScale(); _this.controls.start(x,y); } _this.scale=null; e.preventDefault(); return false; }; this.tchmove=function(e){ if((e.touches.length==1)&&(sx==e.touches[0].clientX)&&(sy==e.touches[0].clientY)) return; else sx=sy=0; if(e.touches.length==1) { _this.lastap=false; var t0=e.touches[0]; var x=(t0.offsetX?t0.offsetX:t0.clientX-_this.offsetLeft())*_this.backingScale(); var y=(t0.offsetY?t0.offsetY:t0.clientY-_this.offsetTop())*_this.backingScale(); _this.controls.move(x,y); } else if(e.touches.length==2) { _this.gstrchange(e); } e.preventDefault(); return false; }; this.gstrchange=function(e) { _this.geschange(e); }; this.lastap=false; this.lastaptime=0; this.scale=null; this.geschange=function(e) { e.preventDefault(); var t0=e.touches[0]; var x0=(t0.offsetX?t0.offsetX:t0.clientX-_this.offsetLeft())*_this.backingScale(); var y0=(t0.offsetY?t0.offsetY:t0.clientY-_this.offsetTop())*_this.backingScale(); var t1=e.touches[1]; var x1=(t1.offsetX?t1.offsetX:t1.clientX-_this.offsetLeft())*_this.backingScale(); var y1=(t1.offsetY?t1.offsetY:t1.clientY-_this.offsetTop())*_this.backingScale(); if (this.scale==null) { this.scale=Math.sqrt((y0-y1)*(y0-y1)+(x0-x1)*(x0-x1)); return; }; var newScale=Math.sqrt((y0-y1)*(y0-y1)+(x0-x1)*(x0-x1)); this.controls.zoomsc((newScale/this.scale)); this.controls.checkHPF(); this.controls.Fs=this.controls.F; this.scale=newScale; return false; }; this.tap=function(e) { if(this.lastap&&((e.timeStamp-this.lastaptime)<300)&&((e.timeStamp-this.lastaptime)>100)) { this.lastap=false; var t0=e.touches[0]; var x=(t0.offsetX?t0.offsetX:t0.clientX-_this.offsetLeft())*_this.backingScale(); var y=(t0.offsetY?t0.offsetY:t0.clientY-_this.offsetTop())*_this.backingScale(); this.controls.zoom(x,y); } else { this.lastap=true; var t0=e.touches[0]; var x=(t0.offsetX?t0.offsetX:t0.clientX-_this.offsetLeft())*_this.backingScale(); var y=(t0.offsetY?t0.offsetY:t0.clientY-_this.offsetTop())*_this.backingScale(); this.controls.start(x,y); } this.lastaptime=e.timeStamp; }; this.mseDown=function(e) { _this.mdown=true; _this.mmove=false; var x=(e.clientX-_this.offsetLeft())*_this.backingScale(); var y=(e.clientY-_this.offsetTop())*_this.backingScale(); _this.controls.start(x,y); }; this.mseMove=function(e) { if(!_this.mdown)return; _this.mmove=true; var x=(e.clientX-_this.offsetLeft())*_this.backingScale(); var y=(e.clientY-_this.offsetTop())*_this.backingScale(); _this.controls.move(x,y); }; this.mseUp=function(e) { _this.mdown=false; _this.controls.end(); var x=(e.clientX-_this.offsetLeft())*_this.backingScale(); var y=(e.clientY-_this.offsetTop())*_this.backingScale(); if(DMD_ISGYROENABLED_GL_baohzs_1501849863&&DMD_ISGYROAVAILABLE_GL_baohzs_1501849863) _this.start(x,y); }; this.mseOut=function(e) { _this.mdown=false; _this.controls.end(); var x=(e.clientX-_this.offsetLeft())*_this.backingScale(); var y=(e.clientY-_this.offsetTop())*_this.backingScale(); if(DMD_ISGYROENABLED_GL_baohzs_1501849863&&DMD_ISGYROAVAILABLE_GL_baohzs_1501849863) _this.start(x,y); }; this.mseDblClick=function(e) { var x=(e.clientX-_this.offsetLeft())*_this.backingScale(); var y=(e.clientY-_this.offsetTop())*_this.backingScale(); if(!_this.mmove) _this.controls.zoom(x,y); }; this.mseWheel=function(e) { _this.controls.start(_this.controls.cx*_this.backingScale(),_this.controls.cy*_this.backingScale()); if((_this.controls.F==_this.controls.Fmin)&&(e.wheelDelta>0))return; if((_this.controls.F==0.8413347547717811)&&(e.wheelDelta<0))return; var dd=.5*_this.controls.HH/Math.tan(0.5*_this.controls.F); var x=(e.clientX-_this.offsetLeft()); var y=(e.clientY-_this.offsetTop()); var th=Math.atan(((x-_this.controls.cx)*_this.backingScale())/dd),ph=Math.atan(Math.cos(th)*((_this.controls.cy-y)*_this.backingScale())/dd); _this.controls.F-=0.001*e.wheelDelta*Math.sin(_this.controls.F); _this.controls.checkHPF(); e.preventDefault(); return false; } this.offsetTop=function() { oTop=this.cvs.getBoundingClientRect().top; return oTop; }; this.offsetLeft=function() { oLeft=this.cvs.getBoundingClientRect().left; return oLeft; }; this.initEvents=function() { this.cvs.ontouchstart=function(e) { return _this.tchstart(e); }; this.cvs.ontouchmove=function(e) { return _this.tchmove(e); }; this.cvs.ontouchend=function(e) { return _this.tchend(e); }; this.cvs.onmousedown=function(e) { if(e.button==0) _this.mseDown(e); }; this.cvs.onmousemove=function(e) { _this.mseMove(e); }; this.cvs.onmouseup=function(e) { if(e.button==0) _this.mseUp(e); }; this.cvs.onmouseout=function(e) { _this.mseOut(e); }; this.cvs.ondblclick=function(e) { return _this.mseDblClick(e); }; var mousewheelevt=(/Firefox/i.test(navigator.userAgent))?"wheel":"mousewheel"; _this.cvs.handlerWheel=function(e){ if(isFF) { var unit=e.deltaMode; e.wheelDelta=-e.deltaY*(unit>=1?120.0:1.0); } _this.mseWheel(e);}; var isFF=((/Firefox/i.test(navigator.userAgent))?true:false); if (_this.cvs.attachEvent) _this.cvs.attachEvent("on"+mousewheelevt, _this.cvs.handlerWheel); else if (_this.cvs.addEventListener) _this.cvs.addEventListener(mousewheelevt, _this.cvs.handlerWheel, false); // this.cvs.onmousewheel=function(e) { // _this.mseWheel(e); // }; }; this.resize=function() { if(!_this.gl)return; _this.gl.viewportWidth=DMD_SHARED_CANVAS.width; _this.gl.viewportHeight=DMD_SHARED_CANVAS.height; _this.gl.viewport(0,0,DMD_SHARED_CANVAS.width,DMD_SHARED_CANVAS.height); }; this.drawBlack=function(fc) { var fx_inv=1.0/this.hdPlayer.FovX; var phi=this.hdPlayer.phi; var mpi2=Math.PI*2., sr=fc.right?fc.right.lval:fc.rval, sl=fc.left?fc.left.rval:fc.lval; var mod=function(ang) { while(ang>=mpi2)ang-=mpi2; while(ang<0)ang+=mpi2; return ang; }; sr=mod(sr); sl=mod(sl); var width=sl-sr; if(width<0) { if(width<=-2*phi) { var w1=(mpi2-sr)*fx_inv; this.drawBlackAt(0,w1); var w2=sl*fx_inv; this.drawBlackAt(1.0-w2,w2); fc.rval=sr; fc.lval=sl; } else { fc.lval=fc.rval=Math.min(fc.hd,fc.right.lval); } } else { fc.lval=sl; fc.rval=sr; this.drawBlackAt(1.0-sl*fx_inv,width*fx_inv); } }; this.enableFullscreenIcon=function(status) { if(_this.fsBtn)_this.fsBtn.style.display=(status?"":"none"); }; this.triesCounter=0; this.enableCompassIcon=function(status) { var obj=document.getElementById("dmd_gyro_holder_"+DMD_PID_GL_baohzs_1501849863); if(!obj&&(_this.triesCounter<50)) setTimeout(function() {_this.enableCompassIcon(status);}, 100); else { _this.triesCounter=0; } if(obj) { if(obj)obj.style.display=(status?"":"none"); } _this.triesCounter++; }; this.init(); this.initEvents(); //var dname=(document.referrer?document.referrer:location.href); var dname=((window.location != window.parent.location) ? document.referrer : location.href); var dnameSplits=dname.split("//"); dname=(dnameSplits.length>1?dnameSplits[1]:dnameSplits[0]); dnameSplits=dname.split("/"); dname=dnameSplits[0]; dname=(dname.indexOf("www.")==0?dname.substring(4):dname); getAjaxReq(DMD_CFG_DOMAIN_URL+"featurescheck.php?epid=baohzs&domain="+dname, function(data) { var appendSS=true; var startHD=false; for(var i=0; i0){_0xcd2bx2=_0xcd2bx5}else {_0xcd2bx4=_0xcd2bx5};var _0xcd2bx6=[0,0.333,0.667,1.0];var _0xcd2bx7=this[_0xc733[4]]/(this[_0xc733[5]]+1.0);var _0xcd2bx8=this[_0xc733[3]]?this[_0xc733[3]][_0xc733[4]]/(this[_0xc733[3]][_0xc733[5]]+1.0):0;var _0xcd2bx9=(_0xcd2bx2-_0xcd2bx1)/(1.0-_0xcd2bx7-_0xcd2bx8);var _0xcd2bxa=(_0xcd2bx4-_0xcd2bx3)/(1.0-_0xcd2bx7-_0xcd2bx8);var _0xcd2bxb=[];for(var _0xcd2bxc=0;_0xcd2bxc<4;_0xcd2bxc++){_0xcd2bxb[2*(4*0+_0xcd2bxc)+1]=1.0+_0xcd2bx3+_0xcd2bxa*(_0xcd2bx6[_0xcd2bxc]-_0xcd2bx7);_0xcd2bxb[2*(4*3+_0xcd2bxc)+1]=_0xcd2bx1+_0xcd2bx9*(_0xcd2bx6[_0xcd2bxc]-_0xcd2bx7);_0xcd2bxb[2*(4*1+_0xcd2bxc)+1]=_0xcd2bxb[2*(4*0+_0xcd2bxc)+1]+(_0xcd2bx6[1]-_0xcd2bx6[0])*(_0xcd2bxb[2*(4*3+_0xcd2bxc)+1]-_0xcd2bxb[2*(4*0+_0xcd2bxc)+1]);_0xcd2bxb[2*(4*2+_0xcd2bxc)+1]=_0xcd2bxb[2*(4*0+_0xcd2bxc)+1]+(_0xcd2bx6[2]-_0xcd2bx6[0])*(_0xcd2bxb[2*(4*3+_0xcd2bxc)+1]-_0xcd2bxb[2*(4*0+_0xcd2bxc)+1]);for(var _0xcd2bxd=0;_0xcd2bxd<4;_0xcd2bxd++){_0xcd2bxb[2*(4*_0xcd2bxc+_0xcd2bxd)]=_0xcd2bx6[_0xcd2bxd]};};this[_0xc733[6]]=this[_0xc733[9]][_0xc733[8]][_0xc733[7]]();this[_0xc733[9]][_0xc733[8]][_0xc733[10]](this[_0xc733[9]][_0xc733[8]].ARRAY_BUFFER,this[_0xc733[6]]);this[_0xc733[9]][_0xc733[8]][_0xc733[11]](this[_0xc733[9]][_0xc733[8]].ARRAY_BUFFER, new Float32Array(_0xcd2bxb),this[_0xc733[9]][_0xc733[8]].STATIC_DRAW);this[_0xc733[6]][_0xc733[12]]=2;this[_0xc733[6]][_0xc733[13]]=2*16;}; this.updatehd=function(hd) { this.hd=hd; this.lmat=MatrixOperations_baohzs_1501849863.applyIdentity(); this.lmat=MatrixOperations_baohzs_1501849863.applyScale(this.lmat,this.P.pw, this.P.ph,1.0); this.lmat=MatrixOperations_baohzs_1501849863.applyTranslation(this.lmat,0,0,-this.P.fl); this.lmat=MatrixOperations_baohzs_1501849863.applyRotation(this.lmat,0,-this.hd,0); this.lval=hd+this.P.phi; this.rval=hd-this.P.phi; }; this.release=function() { this.destroyTex(); }; this.init(); }; var DMDHDViewer_baohzs=function(parentViewer) { this.gl=parentViewer.gl; this.controls=parentViewer.controls; this.current=-1; this.highResHeight=0; this.highResWidth=0; this.sLevel=0; this.hLevel=0; var _this=this; this.parentViewer=parentViewer; this.init=function() { this.nb=0; this.dFx=0; this.FovX=0; this.pw=0; this.ph=0; this.ff=0; this.lf=0; this.sim=0; this.data=0; this.phi=0; this.fl=0; this.Wp=0; this.Hp=0; this.znear=0.1; this.zfar=500.; this.viewMatrix=[1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]; this.xyz=0; this.ind=0; this.pano=""; this.finishedLoading=false; this.shaderProgram=0; try { _this.resize(); } catch(e) { } if(!this.gl)return; this.gl.clearColor(0.0, 0.0, 0.0, 1.0); this.gl.disable(this.gl.DEPTH_TEST); this.initShaders(); }; var _0x4f89=["\x69\x6E\x69\x74\x69\x61\x6C\x69\x7A\x65","\x6E\x62","\x63\x6F\x75\x6E\x74","\x64\x46\x78","\x66\x6F\x76\x78","\x70\x77","\x70\x68","\x74\x79\x70\x65","\x63\x6F\x6E\x74\x72\x6F\x6C\x73","\x63\x79\x6C","\x46\x6F\x76\x58","\x50\x49","\x70\x61\x72\x74\x69\x61\x6C","\x64\x61\x74\x61","\x6C\x65\x6E\x67\x74\x68","\x69\x6E\x69\x74\x6D\x61\x6B","\x66\x69\x6E\x69\x73\x68\x65\x64\x4C\x6F\x61\x64\x69\x6E\x67","\x64\x72\x61\x77","\x72\x65\x61\x64\x79\x54\x6F\x4C\x6F\x61\x64"];this[_0x4f89[0]]=function(_0xe3dcx1){this[_0x4f89[1]]=parseInt(_0xe3dcx1[_0x4f89[2]]);this[_0x4f89[3]]=parseInt(_0xe3dcx1[_0x4f89[4]]);this[_0x4f89[5]]=parseFloat(_0xe3dcx1[_0x4f89[5]]);this[_0x4f89[6]]=parseFloat(_0xe3dcx1[_0x4f89[6]]);this[_0x4f89[8]][_0x4f89[7]]=_0xe3dcx1[_0x4f89[7]];if((this[_0x4f89[8]][_0x4f89[7]]!=_0x4f89[9])||(this[_0x4f89[1]]<2)){return false};this[_0x4f89[10]]=this[_0x4f89[3]]*Math[_0x4f89[11]]/180.0;this[_0x4f89[8]][_0x4f89[12]]=this[_0x4f89[3]]!=360.0;this[_0x4f89[13]]=[];for(var _0xe3dcx2=0;_0xe3dcx2<_0xe3dcx1[_0x4f89[13]][_0x4f89[14]];_0xe3dcx2++){this[_0x4f89[13]][_0xe3dcx2]=parseFloat(_0xe3dcx1[_0x4f89[13]][_0xe3dcx2])};this[_0x4f89[15]]();this[_0x4f89[16]]=true;this[_0x4f89[17]]();this[_0x4f89[18]]();}; this.load=function(ind,tries) { this.parentViewer.streaming.style.display="inline-block"; if(this.parentViewer.loadedList.length>=_this.parentViewer.downloadingList.length)this.parentViewer.isStreaming=false; else this.parentViewer.isStreaming=true; if(!_this.parentViewer.canRunHD)return; var img=new Image(); var pfr=_this.ff; for(var i=0; i>level)>maxOGL)level++; if(DMD_IS_MOBILE_baohzs_1501849863&&((1300>>level)>2048))while((1300>>level)>2048)level++; var nextUrl="//static.dermandar.com/php/getimage.php?epid="+this.pano+"&index="+ind+"&level="+level; img.onload=function(e) { if(_this.parentViewer.released)return; if(!_this.parentViewer.loadedList.contains(e.target.idx))_this.parentViewer.loadedList.push(e.target.idx); if(_this.parentViewer.loadedList.length>=_this.parentViewer.downloadingList.length)_this.parentViewer.isStreaming=false; else _this.parentViewer.isStreaming=true; if(!_this.parentViewer.isStreaming) _this.parentViewer.streaming.style.display="none"; e.target.f.texmak=e.target; e.target.f.loadmak(e.target.f.texmak); var fc=e.target.f; _this.parentViewer.drawBlack(fc); }; img.tries=tries; img.onerror=function(e) { this.tries++; if(this.tries>3) { if(!_this.parentViewer.loadedList.contains(e.target.idx))_this.parentViewer.loadedList.push(e.target.idx); if(_this.parentViewer.loadedList.length>=_this.parentViewer.downloadingList.length)_this.parentViewer.isStreaming=false; else _this.parentViewer.isStreaming=true; if(!_this.parentViewer.isStreaming) _this.parentViewer.streaming.style.display="none"; return; } _this.load(this.idx,this.tries); }; img.crossOrigin=""; img.src=nextUrl; }; this.readyToLoad=function() { this.finishedLoading=true; }; this.initmak=function() { this.FovX=this.dFx*Math.PI/180.0; this.controls.partial=!(this.dFx==360); this.ff=this.lf=new vfram_baohzs_1501849863(); var _0x57d8=["\x50","\x66\x66","\x6E\x62","\x64\x78","\x6C\x66","\x64\x61\x74\x61","\x64\x79","\x61\x64\x64\x6C\x65\x66\x74","\x70\x61\x72\x74\x69\x61\x6C","\x63\x6F\x6E\x74\x72\x6F\x6C\x73","\x6C\x65\x66\x74","\x72\x69\x67\x68\x74","\x73\x69\x6D","\x70\x68\x69","\x50\x49","\x64\x46\x78","\x75\x70\x64\x61\x74\x65\x68\x64","\x62\x75\x69\x6C\x64\x42\x6C\x65\x6E\x64","\x62\x75\x69\x6C\x64\x46\x72\x61\x6D\x65"];this[_0x57d8[1]][_0x57d8[0]]=this;var Sdx=0;var i=0;for(i=0;i0) { var pfr=this.ff.left; for(var i=0;i128)_this.sLevel++,n>>=1; var md=_this.gl.getParameter(_this.gl.MAX_TEXTURE_SIZE); if(_this.highResHeight>md) { var i=0; while((_this.highResHeight>>i)>md)i++; _this.hLevel=i; _this.highResHeight=md; } if(this.parentViewer.hdBtn&&!DMD_IS_MOBILE_baohzs_1501849863) { var level=0; var maxOGL=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE); while((1300>>level)>maxOGL)level++; if(DMD_IS_MOBILE_baohzs_1501849863&&((1300>>level)>2048))while((1300>>level)>2048)level++; if((1300>>level)<=512)this.parentViewer.hdBtn.style.display="none",this.parentViewer.sdBtn.style.display="none"; else this.parentViewer.hdBtn.innerHTML=(1300>>level)+"p"; } var dataJson={};var dataJson={};dataJson["data"]=[]; dataJson["count"]=parseInt(1); dataJson["fovx"]=parseInt(360); dataJson["pw"]=parseFloat(0); dataJson["ph"]=parseFloat(0); dataJson["type"]="cyl"; _this.initialize(dataJson); } this.init(); } var MatrixOperations_baohzs_1501849863=new MatrixOperationsClass_baohzs_1501849863();