threepipe
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

script.ts 911B

1234567891011121314151617181920212223242526272829303132
  1. import {
  2. _testFinish,
  3. _testStart,
  4. ContactShadowGroundPlugin,
  5. IObject3D,
  6. LoadingScreenPlugin,
  7. ThreeViewer,
  8. } from 'threepipe'
  9. import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'
  10. async function init() {
  11. const viewer = new ThreeViewer({
  12. canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
  13. renderScale: 'auto',
  14. plugins: [LoadingScreenPlugin],
  15. })
  16. viewer.addPluginSync(ContactShadowGroundPlugin)
  17. await Promise.all([
  18. viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr'),
  19. viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf'),
  20. ])
  21. const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))
  22. ui.setupPluginUi(ContactShadowGroundPlugin, {expanded: true})
  23. }
  24. _testStart()
  25. init().finally(_testFinish)