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

script.ts 859B

123456789101112131415161718192021222324
  1. import {_testFinish, ContactShadowGroundPlugin, 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. renderScale: 'auto',
  7. plugins: [LoadingScreenPlugin],
  8. })
  9. viewer.addPluginSync(ContactShadowGroundPlugin)
  10. 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/DamagedHelmet/glTF/DamagedHelmet.gltf'),
  13. ])
  14. const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))
  15. ui.setupPluginUi(ContactShadowGroundPlugin, {expanded: true})
  16. }
  17. init().finally(_testFinish)