threepipe
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 1.7KB

11 miesięcy temu
11 miesięcy temu
11 miesięcy temu
11 miesięcy temu
11 miesięcy temu
11 miesięcy temu
11 miesięcy temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Dispose + Reimport Test with config</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. }
  15. }
  16. </script>
  17. <style id="example-style">
  18. html, body, #canvas-container, #mcanvas {
  19. width: 100%;
  20. height: 100%;
  21. margin: 0;
  22. overflow: hidden;
  23. }
  24. </style>
  25. <script type="module" src="../examples-utils/global-loading.mjs"></script>
  26. <script type="module" src="../examples-utils/simple-code-preview.mjs"></script>
  27. <script id="example-script" type="module">
  28. import {_testFinish, _testStart, ThreeViewer, timeout, Color} from 'threepipe'
  29. const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas')})
  30. async function init() {
  31. const model = await viewer.load('https://asset-samples.threepipe.org/demos/classic-watch.glb')
  32. viewer.scene.backgroundColor = new Color(0x000000)
  33. await timeout(500)
  34. viewer.scene.disposeSceneModels()
  35. await timeout(500)
  36. // should load white bg
  37. const model2 = await viewer.load('https://asset-samples.threepipe.org/demos/classic-watch.glb')
  38. }
  39. _testStart()
  40. init().finally(_testFinish)
  41. </script>
  42. </head>
  43. <body>
  44. <div id="canvas-container">
  45. <canvas id="mcanvas"></canvas>
  46. </div>
  47. </body>