Published
Edited
Nov 17, 2021
Importers
Insert cell
Insert cell
viewof modelObj = Inputs.select(
new Map([
["boy", boyObj],
["rayman", raymanObj],
["teapot", teapotObj],
["windmill", windmillObj],
["goat", goatObj]
]),
{ value: teapotObj, label: "Choose Model" }
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
bufferInfoArray = vertexAttributes.map((vertexAttributes) =>
twgl.createBufferInfoFromArrays(gl, vertexAttributes)
)
Insert cell
Insert cell
Insert cell
Insert cell
vertexAttributes = modelObj.map((d) => ({
position: { numComponents: 3, data: d.sc.positions },
normal: { numComponents: 3, data: d.sc.normals }
}))
Insert cell
Insert cell
Insert cell
teapotObj = loadModelFromURL(teapotURL, "obj") //loadObjObject(teapotURL)
Insert cell
teapotURL = FileAttachment("teapot.obj").url()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
houseObj = loadModelFromURL(
await FileAttachment("247_House 15_obj.obj").url(),
"obj"
)
Insert cell
goatObj = loadModelFromURL(
await FileAttachment("goat.obj").url(),
"obj"
)
Insert cell
Insert cell
Insert cell
import {
loadModelFromURL,
computeModelExtent
} from "@spattana/model-loaders-using-threejs"
Insert cell
twgl = require("twgl.js")
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