threepipe
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Blend 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-blend-importer": "./../../plugins/blend-importer/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/global-loading.mjs"></script>
  27. <script type="module" src="../examples-utils/simple-code-preview.mjs"></script>
  28. <script id="example-script" type="module">
  29. import {_testFinish, _testStart, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
  30. import {BlendLoadPlugin} from '@threepipe/plugin-blend-importer'
  31. const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas'), dropzone: {
  32. addOptions: {clearSceneObjects: true}
  33. }})
  34. viewer.addPluginsSync([BlendLoadPlugin, LoadingScreenPlugin])
  35. async function init() {
  36. await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
  37. const result = await viewer.load('https://asset-samples.threepipe.org/minimal/default-cube.blend', {
  38. autoCenter: true,
  39. autoScale: false,
  40. })
  41. console.log(result)
  42. }
  43. _testStart()
  44. init().finally(_testFinish)
  45. </script>
  46. </head>
  47. <body>
  48. <div id="canvas-container">
  49. <canvas id="mcanvas"></canvas>
  50. </div>
  51. </body>