threepipe
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

123456789101112131415161718192021222324252627
  1. import {_testFinish, _testStart, IObject3D, LoadingScreenPlugin, ThreeViewer, TonemapPlugin} from 'threepipe'
  2. import {BlueprintJsUiPlugin} from '@threepipe/plugin-blueprintjs'
  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 BlueprintJsUiPlugin())
  10. ui.appendChild(viewer.uiConfig)
  11. ui.setupPluginUi(TonemapPlugin)
  12. await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
  13. const result = await viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf', {
  14. autoCenter: true,
  15. autoScale: true,
  16. })
  17. const mesh = result?.getObjectByName('node_damagedHelmet_-6514')
  18. ui.appendChild(mesh?.uiConfig)
  19. }
  20. _testStart()
  21. init().finally(_testFinish)