| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>I3DM (Instanced 3D Model, OGC Tiles) 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/global-loading.mjs"></script>
- <script type="module" src="../examples-utils/simple-code-preview.mjs"></script>
- <script id="example-script" type="module">
- import {_testFinish, _testStart, LoadingScreenPlugin, ThreeViewer, Vector3} from 'threepipe'
- import {I3DMLoadPlugin} from '@threepipe/plugin-3d-tiles-renderer'
-
-
- const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas'), msaa: true})
- viewer.addPluginsSync([I3DMLoadPlugin, LoadingScreenPlugin])
-
- async function init() {
-
- await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
-
- // https://github.com/CesiumGS/3d-tiles-samples
- // https://github.com/NASA-AMMOS/3DTilesRendererJS/blob/master/example/data/root.b3dm
- const result = await viewer.load('https://raw.githubusercontent.com/CesiumGS/3d-tiles-samples/main/1.0/TilesetWithTreeBillboards/tree.i3dm', {
- autoCenter: true,
- autoScale: true,
- autoScaleRadius: 5,
- })
- console.log(result)
- }
-
- _testStart()
- init().finally(_testFinish)
- </script>
- </head>
- <body>
- <div id="canvas-container">
- <canvas id="mcanvas"></canvas>
- </div>
-
- </body>
|