threepipe
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536
  1. import {_testFinish, IObject3D, LoadingScreenPlugin, 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. plugins: [LoadingScreenPlugin],
  8. })
  9. async function init() {
  10. const [env, model, model2] = await Promise.all([
  11. viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr'),
  12. viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/IridescenceLamp.glb', {
  13. autoCenter: true,
  14. autoScale: true,
  15. }),
  16. viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/IridescentDishWithOlives.glb', {
  17. autoCenter: true,
  18. autoScale: true,
  19. }),
  20. ])
  21. console.log(env, model, model2)
  22. if (!model || !model2) {
  23. console.error('model not loaded')
  24. return
  25. }
  26. model.position.x = -1
  27. model2.position.x = 1
  28. model2.position.y = -1.2
  29. }
  30. init().finally(_testFinish)