threepipe
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>DZI (Deep Zoom Image) Load</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <!-- Import maps polyfill -->
  8. <!-- Remove this when import maps will be widely supported -->
  9. <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script>
  10. <script type="importmap">
  11. {
  12. "imports": {
  13. "threepipe": "./../../dist/index.mjs",
  14. "@threepipe/plugin-3d-tiles-renderer": "./../../plugins/3d-tiles-renderer/dist/index.mjs"
  15. }
  16. }
  17. </script>
  18. <style id="example-style">
  19. html, body, #canvas-container, #mcanvas {
  20. width: 100%;
  21. height: 100%;
  22. margin: 0;
  23. overflow: hidden;
  24. }
  25. </style>
  26. <script type="module" src="../examples-utils/simple-code-preview.mjs"></script>
  27. <script id="example-script" type="module" lang="ts">
  28. import {_testFinish, LoadingScreenPlugin, ThreeViewer, SSAAPlugin} from 'threepipe'
  29. import {DeepZoomImageLoadPlugin} from '@threepipe/plugin-3d-tiles-renderer'
  30. const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas'), msaa: true, renderScale: window.devicePixelRatio, tonemap: false})
  31. viewer.addPluginsSync([DeepZoomImageLoadPlugin, LoadingScreenPlugin, SSAAPlugin])
  32. // todo why is camera change required here to start rendering?
  33. async function init() {
  34. viewer.scene.mainCamera.position.set(0,0, 20)
  35. viewer.scene.mainCamera.minNearPlane = 0.1
  36. viewer.scene.mainCamera.setDirty()
  37. // https://github.com/CesiumGS/3d-tiles-samples
  38. // from https://github.com/NASA-AMMOS/3DTilesRendererJS/blob/master/example/data/root.b3dm
  39. const result = await viewer.load('https://openseadragon.github.io/example-images/duomo/duomo.dzi', {
  40. autoCenter: true,
  41. autoScale: true,
  42. autoScaleRadius: 30,
  43. tiles: {
  44. DeepZoomImagePlugin: {
  45. center: true
  46. },
  47. errorTarget: 1,
  48. }
  49. })
  50. viewer.setDirty()
  51. console.log(result)
  52. }
  53. init().finally(_testFinish)
  54. </script>
  55. </head>
  56. <body>
  57. <div id="canvas-container">
  58. <canvas id="mcanvas"></canvas>
  59. </div>
  60. </body>