threepipe
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

2 лет назад
2 лет назад
1234567891011121314151617181920212223242526272829303132
  1. import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeViewer, USDZLoadPlugin} 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: ['usdz', 'usda', 'hdr', 'exr'],
  8. addOptions: {
  9. disposeSceneObjects: true,
  10. autoSetEnvironment: true, // when hdr is dropped
  11. autoSetBackground: true,
  12. },
  13. },
  14. plugins: [LoadingScreenPlugin],
  15. })
  16. viewer.addPluginSync(USDZLoadPlugin)
  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/usdz/saeukkang.usdz', options),
  24. ])
  25. }
  26. init().finally(_testFinish)