Published
Edited
Nov 17, 2020
Importers
3 stars
Insert cell
Insert cell
/*scaledTeapot = {
const xExtent = d3.extent(teapot.positions,d=>d[0]);
const yExtent = d3.extent(teapot.positions,d=>d[1]);
const zExtent = d3.extent(teapot.positions,d=>d[2]);
const sTeapot = ({positions: teapot.positions.map(d=>[d[0]/xExtent[1],0.7*(2*d[1]/yExtent[1]-1),d[2]/xExtent[1]]), cells:teapot.cells.slice()});
sTeapot.normals = computeNormals(sTeapot.cells,sTeapot.positions);
return sTeapot;
}*/
Insert cell
Insert cell
Insert cell
Insert cell
scaledCow = scaledSC(cow)
Insert cell
Insert cell
Insert cell
Insert cell
scaledTeddy = scaledSC(teddy)
Insert cell
scaledWindmill = scaledSC(obj2sc(await d3.text("https://threejsfundamentals.org/threejs/resources/models/windmill/windmill.obj")))
Insert cell
Insert cell
scaledBoy = scaledSC(boy)
Insert cell
boy = obj2sc(boyObj)
Insert cell
boyObj = FileAttachment("BoyOBJ.obj").text()
Insert cell
Insert cell
Insert cell
import {scaledSC} from "@spattana/ply-data-for-regl"
Insert cell
Insert cell
threejs = require("three")
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

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