UNPKG

threepipe

Version:

A 3D viewer framework built on top of three.js in TypeScript with a focus on quality rendering, modularity and extensibility.

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