UNPKG

threepipe

Version:

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

53 lines (44 loc) 1.5 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>FBX Load</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Import maps polyfill --> <!-- Remove this when import maps will be widely supported --> <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> <script type="importmap"> { "imports": { "threepipe": "./../../dist/index.mjs" } } </script> <style id="example-style"> html, body, #canvas-container, #mcanvas { width: 100%; height: 100%; margin: 0; overflow: hidden; } </style> <script type="module" src="../examples-utils/simple-code-preview.mjs"></script> <script id="example-script" type="module"> import {_testFinish, HemisphereLight, ThreeViewer} from 'threepipe' const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas')}) async function init() { viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10)) const result = await viewer.load('https://threejs.org/examples/models/fbx/Samba Dancing.fbx', { autoCenter: true, autoScale: true, }) console.log(result) } init().finally(_testFinish) </script> </head> <body> <div id="canvas-container"> <canvas id="mcanvas"></canvas> </div> </body>