Published
Edited
Sep 6, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
loadModelFromURL(modelURL, "obj")
Insert cell
Insert cell
xyzArray = modelSCs[0].sc.positions
Insert cell
xArray = xyzArray.filter( (element,i) =>( i%3 == 0))
Insert cell
yArray = xyzArray.filter( (element,i) =>( i%3 == 1))
Insert cell
zArray = xyzArray.filter( (element,i) =>( i%3 == 2))
Insert cell
d3.min(xArray)
Insert cell
modelExtents = [
{min: [d3.min(xArray), d3.min(yArray), d3.min(zArray)],
max: [d3.max(xArray), d3.max(yArray), d3.max(zArray)]}
]
Insert cell
vertexAttributes = [
{position: {numComponents: 3, data: new Float32Array(56880)},
normal: {numComponents: 3, data: new Float32Array(56880)}}
]
Insert cell
Insert cell
modelURL = await FileAttachment("teapot.obj").url()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require("d3-array@>=2.1")
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