| 1234567891011121314151617181920212223242526272829303132 |
- import {
- _testFinish,
- _testStart,
- ContactShadowGroundPlugin,
- IObject3D,
- LoadingScreenPlugin,
- ThreeViewer,
- } from 'threepipe'
- import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'
-
- async function init() {
-
- const viewer = new ThreeViewer({
- canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
- renderScale: 'auto',
- plugins: [LoadingScreenPlugin],
- })
-
- viewer.addPluginSync(ContactShadowGroundPlugin)
-
- await Promise.all([
- viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr'),
- viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf'),
- ])
-
- const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))
- ui.setupPluginUi(ContactShadowGroundPlugin, {expanded: true})
-
- }
-
- _testStart()
- init().finally(_testFinish)
|