| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- {% load staticfiles %}
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>VR</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <meta name="format-detection" content="telephone=no">
- <script src="{% static '/lib/js/three.js' %}"></script>
- <script src="{% static '/lib/js/mxreality.js' %}"></script>
- <style type="text/css">
- /*#example {
- position: absolute;
- width: 100%;
- height: 100%;
- left:0px;
- top:0px;
- overflow: hidden;
- }*/
- </style>
- </head>
- <body>
- <div id="example"></div>
- <input type="text" id="imgpath" value="{{img}}">
- <script>
- window.onload=function () {
- init();
- }
- function init() {
- var scene, renderer;
- var container;
- renderer = new THREE.WebGLRenderer();
- container = document.getElementById('example');
- container.appendChild(renderer.domElement);
- scene = new THREE.Scene();
- var vr=new VR(scene,renderer,container,{'fov':60});
- vr.vrbox.radius=10;
- vr.asteroidConfig.enable=true;
- //vr.asteroidConfig.asteroidTop=-1;
- //vr.effect.separation=5;
- vr.init();
- //vr.controls.object.position.set(0,-7,0);
- //vr.camera.lookAt(0,0,0)
- if(!AVR.isCrossScreen()) {
- vr.useGyroscope = false;
- }
- vr.loadProgressManager.onLoad=function () {
- vr.VRObject.getObjectByName("__panoContainer").visible = true;
- vr.asteroidForward(function () {
- vr.controls.autoRotate=true;
- });
- }
- window.addEventListener("click",function () {
- //vr.controls.object.position.z=0.0001;
- });
- /*setInterval(function () {
- //console.log(vr.controls.object.position.z);
- vr.controls.object.position.z=0.0001;
- },36)*/
- var imgpath = document.getElementById('imgpath').value;
- vr.playPanorama(imgpath);
-
- }
- </script>
- </body>
- </html>
|