threepipe
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

script.ts 826B

1234567891011121314151617181920212223242526
  1. import {_testFinish, IObject3D, ThreeViewer, TweakpaneUiPlugin} from 'threepipe'
  2. async function init() {
  3. const viewer = new ThreeViewer({
  4. canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
  5. msaa: true,
  6. })
  7. const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))
  8. await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr', {
  9. setBackground: true,
  10. })
  11. const result = await viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf', {
  12. autoCenter: true,
  13. autoScale: true,
  14. })
  15. const model = result?.getObjectByName('node_damagedHelmet_-6514')
  16. const config = model?.uiConfig
  17. if (config) ui.appendChild(config)
  18. }
  19. init().then(_testFinish)