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.

script.ts 1.1KB

12345678910111213141516171819202122232425262728293031323334
  1. import {_testFinish, _testStart, IObject3D, LoadingScreenPlugin, PLYLoadPlugin, ThreeViewer} from 'threepipe'
  2. async function init() {
  3. const viewer = new ThreeViewer({
  4. canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
  5. msaa: true,
  6. dropzone: {
  7. allowedExtensions: ['ply', 'hdr'],
  8. addOptions: {
  9. disposeSceneObjects: true,
  10. autoSetEnvironment: true, // when hdr is dropped
  11. autoSetBackground: true,
  12. },
  13. },
  14. plugins: [LoadingScreenPlugin],
  15. })
  16. viewer.addPluginSync(PLYLoadPlugin)
  17. const options = {
  18. autoCenter: true,
  19. autoScale: true,
  20. }
  21. await Promise.all([
  22. viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr'),
  23. viewer.load<IObject3D>('https://threejs.org/examples/models/ply/ascii/dolphins_colored.ply', options),
  24. viewer.load<IObject3D>('https://threejs.org/examples/models/ply/binary/Lucy100k.ply', options),
  25. ])
  26. }
  27. _testStart()
  28. init().finally(_testFinish)