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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>OBJ MTL Load</title>
  6. <!-- Import maps polyfill -->
  7. <!-- Remove this when import maps will be widely supported -->
  8. <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script>
  9. <script type="importmap">
  10. {
  11. "imports": {
  12. "threepipe": "./../../dist/index.mjs"
  13. }
  14. }
  15. </script>
  16. <style id="example-style">
  17. html, body, #canvas-container, #mcanvas {
  18. width: 100%;
  19. height: 100%;
  20. margin: 0;
  21. overflow: hidden;
  22. }
  23. </style>
  24. <script type="module" src="../examples-utils/simple-code-preview.mjs"></script>
  25. <script id="example-script" type="module">
  26. import {_testFinish, HemisphereLight, ThreeViewer} from 'threepipe'
  27. const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas'), msaa: true})
  28. async function init() {
  29. viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10))
  30. const result = await viewer.load('https://threejs.org/examples/models/obj/male02/male02.obj', {
  31. autoCenter: true,
  32. autoScale: true,
  33. })
  34. console.log(result)
  35. }
  36. init().then(_testFinish)
  37. </script>
  38. </head>
  39. <body>
  40. <div id="canvas-container">
  41. <canvas id="mcanvas"></canvas>
  42. </div>
  43. </body>