| 12345678910111213141516171819202122232425262728293031 |
- import {_testFinish, IObject3D, ThreeViewer, USDZLoadPlugin} from 'threepipe'
-
- async function init() {
-
- const viewer = new ThreeViewer({
- canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
- msaa: true,
- dropzone: {
- allowedExtensions: ['usdz', 'usda', 'hdr', 'exr'],
- addOptions: {
- disposeSceneObjects: true,
- autoSetEnvironment: true, // when hdr is dropped
- autoSetBackground: true,
- },
- },
- })
-
- viewer.addPluginSync(USDZLoadPlugin)
-
- const options = {
- autoCenter: true,
- autoScale: true,
- }
- await Promise.all([
- viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr'),
- viewer.load<IObject3D>('https://threejs.org/examples/models/usdz/saeukkang.usdz', options),
- ])
-
- }
-
- init().finally(_testFinish)
|