threepipe
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

script.ts 815B

1234567891011121314151617181920212223242526
  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. })
  9. const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))
  10. ui.appendChild(viewer.scene.mainCamera.uiConfig)
  11. await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
  12. await viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf', {
  13. autoCenter: true,
  14. autoScale: true,
  15. })
  16. }
  17. _testStart()
  18. init().finally(_testFinish)