Public
Edited
Oct 13, 2023
Fork of Three.js
1 fork
Insert cell
Insert cell
renderer.domElement
Insert cell
// Continuously updates
{
while (true) {
renderer.render(scene, camera);
yield null;
}
}
Insert cell
Insert cell
Insert cell
Insert cell
plane = {
// const w = 200;
// const h = 200;
// let data = new Uint8Array(w * h);
// data = data.map(item => item = Math.random() * 256 | 0);
// const texture = new THREE.DataTexture(data, w, h);
const w = 47;
const h = 37;
const texture = new THREE.DataTexture(TestData, w, h);
texture.format = THREE.RedFormat;
texture.minFilter = texture.magFilter = THREE.LinearFilter;
texture.unpackAlignment = 1;
texture.needsUpdate = true;
const material = new THREE.ShaderMaterial({
uniforms: {
u_texture: { value: texture },
},
vertexShader: vertexShader,
fragmentShader: fragmentShader,
})
const geometry = new THREE.PlaneBufferGeometry(width, height);
const plane = new THREE.Mesh(geometry, material);
return plane;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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