Public
Edited
May 19, 2023
Fork of 4D Hypercube
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
rotateAndProjectVertices = {
const m = Array.from({length: 16}, () => new THREE.Vector4());
return ({ xw, yw, zw }) => coordinates.map((v, i) =>
m[i].set(...v)
.applyMatrix4(rotateZW(zw))
.applyMatrix4(rotateYW(yw))
.applyMatrix4(rotateXW(xw))
.applyMatrix4(project(m[i].w))
);
}
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
materials = [
new THREE.LineBasicMaterial({ color: 0x558833 }),
new THREE.LineBasicMaterial({ color: 0x902000 }),
new THREE.LineBasicMaterial({ color: 0x6688aa })
]
Insert cell
Insert cell
scene = {
const scene = new THREE.Scene();
for (let i = 0; i < edges.length; ++i) {
const edge = new THREE.Line(new THREE.Geometry(), getMaterial(edges[i]));
edge.name = `edge_${i}`;
scene.add(edge);
}
return scene;
}
Insert cell
Insert cell
composer = {
const renderer = new THREE.WebGLRenderer();
const controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.enableZoom = false;

invalidation.then(() => (controls.dispose(), renderer.dispose()));
renderer.setSize(width, height);
renderer.setPixelRatio(devicePixelRatio);
controls.addEventListener("change", () => composer.render());

const composer = new THREE.EffectComposer(renderer);
const ssaaRenderPass = new THREE.SSAARenderPass(scene, camera);
const bloomPass = new THREE.UnrealBloomPass(
new THREE.Vector2(width, height),
5,
0,
0
);

composer.addPass(ssaaRenderPass);
composer.addPass(bloomPass);

return composer;
}
Insert cell
THREE = {
const THREE = (window.THREE =
await require("three@0.105.1/build/three.min.js"));
await require("three@0.105.1/examples/js/controls/OrbitControls.js").catch(
() => {}
);
await require("three@0.105.1/examples/js/postprocessing/EffectComposer.js").catch(
() => {}
);
await require("three@0.105.1/examples/js/postprocessing/ShaderPass.js").catch(
() => {}
);
await require("three@0.105.1/examples/js/postprocessing/SSAARenderPass.js").catch(
() => {}
);
await require("three@0.105.1/examples/js/postprocessing/UnrealBloomPass.js").catch(
() => {}
);
await require("three@0.105.1/examples/js/shaders/LuminosityHighPassShader.js").catch(
() => {}
);
await require("three@0.105.1/examples/js/shaders/CopyShader.js").catch(
() => {}
);
//await require("https://github.com/markuslerner/THREE.BlurredLine/blob/master/src/index.js").catch(
// () => {}
// );
return THREE;
}
Insert cell
THREE.BL
Insert cell
// moment = require("three.blurredline")
Insert cell
THREE.MeshLine
Insert cell
test = require("https://github.com/markuslerner/THREE.BlurredLine/blob/master/src/index.js")
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more