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

12345678910111213141516171819202122232425262728
  1. import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
  2. import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'
  3. async function init() {
  4. const viewer = new ThreeViewer({
  5. canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
  6. msaa: true,
  7. plugins: [LoadingScreenPlugin],
  8. camera: {
  9. type: 'orthographic',
  10. },
  11. })
  12. const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))
  13. ui.appendChild(viewer.scene.mainCamera.uiConfig)
  14. await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
  15. await viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf', {
  16. autoCenter: true,
  17. autoScale: true,
  18. })
  19. }
  20. init().finally(_testFinish)