index.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title><!-- title --></title>
  5. <meta charset="utf-8">
  6. <meta name="generator" content="Three.js Editor">
  7. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  8. <style>
  9. body {
  10. font-family: sans-serif;
  11. font-size: 11px;
  12. background-color: #000;
  13. margin: 0px;
  14. overflow: hidden;
  15. }
  16. </style>
  17. </head>
  18. <body ontouchstart="">
  19. <script src="../examples/js/vr/HelioWebXRPolyfill.js"></script>
  20. <script type="module">
  21. import * as THREE from './js/three.module.js';
  22. import { APP } from './js/app.js';
  23. import { VRButton } from './js/VRButton.js';
  24. window.THREE = THREE; // Used by APP Scripts.
  25. window.VRButton = VRButton; // Used by APP Scripts.
  26. var loader = new THREE.FileLoader();
  27. loader.load( 'app.json', function ( text ) {
  28. var player = new APP.Player();
  29. player.load( JSON.parse( text ) );
  30. player.setSize( window.innerWidth, window.innerHeight );
  31. player.play();
  32. document.body.appendChild( player.dom );
  33. window.addEventListener( 'resize', function () {
  34. player.setSize( window.innerWidth, window.innerHeight );
  35. } );
  36. } );
  37. /* edit button */
  38. </script>
  39. </body>
  40. </html>