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

1234567891011121314151617181920212223242526272829303132333435
  1. import {_testFinish, IObject3D, ThreeViewer} from 'threepipe'
  2. const viewer = new ThreeViewer({
  3. canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
  4. msaa: false,
  5. rgbm: true,
  6. zPrepass: false,
  7. })
  8. async function init() {
  9. const [env, model, model2] = await Promise.all([
  10. viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr'),
  11. viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/IridescenceLamp.glb', {
  12. autoCenter: true,
  13. autoScale: true,
  14. }),
  15. viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/IridescentDishWithOlives.glb', {
  16. autoCenter: true,
  17. autoScale: true,
  18. }),
  19. ])
  20. console.log(env, model, model2)
  21. if (!model || !model2) {
  22. console.error('model not loaded')
  23. return
  24. }
  25. model.position.x = -1
  26. model2.position.x = 1
  27. model2.position.y = -1.2
  28. }
  29. init().then(_testFinish)