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 878B

1234567891011121314151617181920212223242526272829
  1. import {_testFinish, _testStart, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
  2. import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'
  3. async function init() {
  4. const viewer = new ThreeViewer({
  5. canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
  6. msaa: true,
  7. plugins: [LoadingScreenPlugin],
  8. camera: {
  9. type: 'orthographic',
  10. },
  11. })
  12. const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))
  13. ui.appendChild(viewer.scene.mainCamera.uiConfig)
  14. await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
  15. await viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf', {
  16. autoCenter: true,
  17. autoScale: true,
  18. })
  19. }
  20. _testStart()
  21. init().finally(_testFinish)