Published
Edited
Mar 12, 2021
Insert cell
Insert cell
THREE = await require(`three/build/three.min.js`)
Insert cell
Insert cell
THREE.REVISION
Insert cell
Insert cell
threeVersion = '0.123'
Insert cell
pinnedTHREE = await require(`three@${threeVersion}/build/three.min.js`)
Insert cell
Insert cell
OrbitControls = await import(`https://unpkg.com/three/examples/jsm/controls/OrbitControls.js`).then(
a => a.OrbitControls
)
Insert cell
Insert cell
globalTHREE = {
const threeVersion = '0.123';
const THREE = await require(`three@${threeVersion}/build/three.min.js`);
async function add(key, file) {
THREE[
key
] = await import(`https://unpkg.com/three@${threeVersion}/examples/${file}`).then(
a => a[key]
);
}
await add('SVGLoader', 'jsm/loaders/SVGLoader.js');
await add('OrbitControls', 'jsm/controls/OrbitControls.js');
await add('BufferGeometryUtils', 'jsm/utils/BufferGeometryUtils.js');
await add('GLTFExporter', 'jsm/exporters/GLTFExporter.js');
await add('GLTFLoader', 'jsm/loaders/GLTFLoader.js');

return THREE;
}
Insert cell
globalTHREE.Object3D
Insert cell
globalTHREE.OrbitControls
Insert cell
globalTHREE.GLTFLoader
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more