Published
Edited
Dec 10, 2020
7 stars
Insert cell
Insert cell
Insert cell
render(scene, camera)
Insert cell
Insert cell
Insert cell
gltfExport = {
const exporter = new THREE.GLTFExporter();
const gltf = await new Promise(resolve =>
exporter.parse(scene, resolve, {
binary: false,
truncateDrawRange: false
})
);
const blob = new Blob([JSON.stringify(gltf)], { type: 'model/gltf+json' });
return DOM.download(blob, 'south-sudan-roads.gltf', 'Save GLTF');
}
Insert cell
glbExport = {
const exporter = new THREE.GLTFExporter();
const glb = await new Promise(resolve =>
exporter.parse([scene, camera], resolve, {
binary: true,
truncateDrawRange: false
})
);
const blob = new Blob([glb], { type: 'model/gltf-binary' });
return DOM.download(blob, 'south-sudan-roads.glb', 'Save GLB');
}
Insert cell
Insert cell
Insert cell
importedGltf = {
const loader = new THREE.GLTFLoader();
const url = await FileAttachment("south-sudan-roads.gltf").url();
return await new Promise(resolve =>
loader.load(url, function(gltf) {
resolve(gltf);
})
);
}
Insert cell
render(importedGltf.scene, importedGltf.cameras[0])
Insert cell
Insert cell
importedGlb = {
const loader = new THREE.GLTFLoader();
const url = await FileAttachment("south-sudan-roads.glb").url();
return await new Promise(resolve =>
loader.load(url, function(glb) {
resolve(glb);
})
);
}
Insert cell
render(importedGlb.scene, importedGlb.cameras[0])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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