threepipe
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

index.html 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>DRACO(DRC) Load</title>
  6. <!-- Import map -->
  7. <script type="importmap">
  8. {
  9. "imports": {
  10. "threepipe": "./../../dist/index.mjs"
  11. }
  12. }
  13. </script>
  14. <style id="example-style">
  15. html, body, #canvas-container, #mcanvas {
  16. width: 100%;
  17. height: 100%;
  18. margin: 0;
  19. overflow: hidden;
  20. }
  21. </style>
  22. <script type="module" src="../js-utils/simple-code-preview.mjs"> </script>
  23. <script id="example-script" type="module">
  24. import {_testFinish, ThreeViewer} from 'threepipe'
  25. const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas')})
  26. async function init() {
  27. await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
  28. const result = await viewer.load('https://threejs.org/examples/models/draco/bunny.drc', {
  29. autoCenter: true,
  30. autoScale: true,
  31. })
  32. console.log(result)
  33. }
  34. init().then(_testFinish)
  35. </script>
  36. </head>
  37. <body>
  38. <div id="canvas-container">
  39. <canvas id="mcanvas"></canvas>
  40. </div>
  41. </body>