| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>DZI (Deep Zoom Image) Load</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- Import maps polyfill -->
- <!-- Remove this when import maps will be widely supported -->
- <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script>
-
- <script type="importmap">
- {
- "imports": {
- "threepipe": "./../../dist/index.mjs",
- "@threepipe/plugin-3d-tiles-renderer": "./../../plugins/3d-tiles-renderer/dist/index.mjs"
- }
- }
-
- </script>
- <style id="example-style">
- html, body, #canvas-container, #mcanvas {
- width: 100%;
- height: 100%;
- margin: 0;
- overflow: hidden;
- }
- </style>
- <script type="module" src="../examples-utils/simple-code-preview.mjs"></script>
- <script id="example-script" type="module" lang="ts">
- import {_testFinish, LoadingScreenPlugin, ThreeViewer, SSAAPlugin} from 'threepipe'
- import {DeepZoomImageLoadPlugin} from '@threepipe/plugin-3d-tiles-renderer'
-
- const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas'), msaa: true, renderScale: window.devicePixelRatio, tonemap: false})
- viewer.addPluginsSync([DeepZoomImageLoadPlugin, LoadingScreenPlugin, SSAAPlugin])
-
- // todo why is camera change required here to start rendering?
-
- async function init() {
-
- viewer.scene.mainCamera.position.set(0,0, 20)
- viewer.scene.mainCamera.minNearPlane = 0.1
- viewer.scene.mainCamera.setDirty()
-
- // https://github.com/CesiumGS/3d-tiles-samples
- // from https://github.com/NASA-AMMOS/3DTilesRendererJS/blob/master/example/data/root.b3dm
- const result = await viewer.load('https://openseadragon.github.io/example-images/duomo/duomo.dzi', {
- autoCenter: true,
- autoScale: true,
- autoScaleRadius: 30,
- tiles: {
- DeepZoomImagePlugin: {
- center: true
- },
- errorTarget: 1,
- }
- })
- viewer.setDirty()
- console.log(result)
- }
-
- init().finally(_testFinish)
- </script>
- </head>
- <body>
- <div id="canvas-container">
- <canvas id="mcanvas"></canvas>
- </div>
-
- </body>
|