25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

144 lines
3.6 KiB

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Pannellum Tests</title>
  7. <link rel="stylesheet" href="../src/css/pannellum.css"/>
  8. <script type="text/javascript" src="../src/js/libpannellum.js"></script>
  9. <script type="text/javascript" src="../src/js/pannellum.js"></script>
  10. <style>
  11. #panorama {
  12. width: 300px;
  13. height: 200px;
  14. }
  15. </style>
  16. </head>
  17. <body>
  18. <div id="panorama"></div>
  19. <script>
  20. viewer = pannellum.viewer('panorama', {
  21. "default": {
  22. "author": "testauthor",
  23. "firstScene": "equirectangular",
  24. "autoLoad": true
  25. },
  26. "scenes": {
  27. "cube": {
  28. "title": "cube title",
  29. "type": "cubemap",
  30. "cubeMap": [
  31. "../examples/multires/1/f00.png",
  32. "../examples/multires/1/r00.png",
  33. "../examples/multires/1/b00.png",
  34. "../examples/multires/1/l00.png",
  35. "../examples/multires/1/u00.png",
  36. "../examples/multires/1/d00.png"
  37. ],
  38. "hotSpots": [
  39. {
  40. "pitch": -12,
  41. "yaw": 170,
  42. "type": "info",
  43. "text": "info test",
  44. },
  45. {
  46. "pitch": -10,
  47. "yaw": -50,
  48. "type": "info",
  49. "text": "link test",
  50. "URL": "https://github.com/mpetroff/pannellum"
  51. },
  52. {
  53. "pitch": 0,
  54. "yaw": -10,
  55. "type": "scene",
  56. "text": "scene test",
  57. "sceneId": "multires"
  58. }
  59. ]
  60. },
  61. "equirectangular": {
  62. "title": "equirectangular title",
  63. "panorama": "../examples/examplepano.jpg"
  64. },
  65. "multires": {
  66. "title": "multires title",
  67. "type": "multires",
  68. "hfov": 85,
  69. "multiRes": {
  70. "basePath": "../examples/multires",
  71. "path": "/%l/%s%x%y",
  72. "fallbackPath": "/fallback/%s",
  73. "extension": "png",
  74. "tileResolution": 256,
  75. "maxLevel": 4,
  76. "cubeResolution": 2048
  77. },
  78. "hotSpots": [
  79. {
  80. "pitch": 20,
  81. "yaw": 20,
  82. "type": "info",
  83. "text": "drag test",
  84. "draggable": true,
  85. "dragHandlerFunc": console.log
  86. }
  87. ]
  88. },
  89. "multires-loader": {
  90. "title": "multires title",
  91. "type": "multires",
  92. "hfov": 85,
  93. "multiRes": {
  94. "basePath": "../examples/multires",
  95. "path": "/%l/%s%x%y",
  96. "fallbackPath": "/fallback/%s",
  97. "extension": "png",
  98. "tileResolution": 256,
  99. "maxLevel": 4,
  100. "cubeResolution": 2048,
  101. "loader": function(node){
  102. var resolver;
  103. var rejector;
  104. var promise = {};
  105. promise.then = function(callback){
  106. resolver = callback;
  107. return promise;
  108. }
  109. promise.catch = function(callback){
  110. rejector = callback;
  111. return promise;
  112. }
  113. var img = document.createElement('img');
  114. img.onload = function () {
  115. if(resolver)
  116. resolver(img);
  117. }
  118. img.onerror = function(err) {
  119. if(rejector)
  120. rejector(err);
  121. }
  122. img.src = node.uri;
  123. return promise;
  124. }
  125. }
  126. }
  127. }
  128. });
  129. </script>
  130. </body>
  131. </html>