Public
Edited
Nov 7, 2023
Insert cell
Insert cell
SPLAT = await import("https://cdn.jsdelivr.net/npm/gsplat@latest")
Insert cell
Insert cell
Insert cell
<canvas id="canvas" height=500px; style="width:500px; height:500px;" />
Insert cell
<meta name="viewport" content="width=device-width, initial-scale=1" />
Insert cell
Insert cell
{
const canvas = document.getElementById("canvas");

const renderer = new SPLAT.WebGLRenderer(canvas);
const scene = new SPLAT.Scene();
const camera = new SPLAT.Camera();
const controls = new SPLAT.OrbitControls(camera, canvas);

async function main() {
const url =
"https://huggingface.co/datasets/dylanebert/3dgs/resolve/main/bonsai/bonsai-7k.splat";

await SPLAT.Loader.LoadAsync(url, scene, null);

const handleResize = () => {
renderer.setSize(window.innerWidth, window.innerHeight);
};

const frame = () => {
controls.update();
renderer.render(scene, camera);

requestAnimationFrame(frame);
};

handleResize();
window.addEventListener("resize", handleResize);

requestAnimationFrame(frame);
}

main();
}
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more