Published
Edited
Sep 7, 2018
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
positions = new Float32Array([
-0.5, 0.5,
0.5, 0.5,
0.5, -0.5,
-0.5, -0.5,
])
Insert cell
positionsBuffer = createBuffer(gl, gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW)
Insert cell
indices = new Uint16Array([
0, 1, 2,
2, 3, 0,
])
Insert cell
indicesBuffer = createBuffer(gl, gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW)
Insert cell
Insert cell
Insert cell
Insert cell
glMatrix = require('gl-matrix')
Insert cell
mat4 = glMatrix.mat4
Insert cell
Insert cell
modelViewMatrix = {
const v = vec3.create();
v.set(v, translateX, translateY, 0);
const m = mat4.create();
mat4.translate(m, m, v);
return m;
}
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