JazonJiao/Manim.js
Tentang
Replicating 3Blue1Brown's math animation engine in JavaScript (p5.js)
Desain dan mediaPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- +1
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliManim.js
![]()
Manim.js aims to emulate 3b1b-style math animations using JavaScript (p5.js).
Subscribe to my new YouTube channel, Jazon Jiao!: https://www.youtube.com/@JazonJiao
I am honored that in 2019, Grant Sanderson from 3b1b recommended my videos, but my original channel no longer exists. Grant also approved the use of "Manim.js" as the name of this project.
Usage: All util classes are located in /src, with detailed documentation. Feel free to use my tools to make your own visualizations of math or CS concepts! As an example, here's how you could create an simple graph. Include this code and other necessary source files in an html file (see, for example, Graph Algorithms/graph.html), and then open the browser.
let G = {
V: [[100, 200], // vertex 0 coordinates on canvas
[260, 100], // vertex 1
[260, 300], // vertex 2
[420, 200], // vertex 3
],
E: [[0, 1], [0, 2], [1, 2], [1, 3], [2, 3]] // edges
};
const GraphExample = function(s) {
let tnr;
s.preload = function() {
tnr = s.loadFont('../lib/font/times.ttf'); // loads font (Times new roman)
};
s.setup = function () {
// this sets frameRate to be 30, and creates a canvas of 1200 by 675 (you can adjust these in globals.js)
setup2D(s);
// creates an undirected graph
s.g = new Graph_U(s, { // parameters are passed in via an object
V: G.V,
E: G.E,
font: tnr,
start: 40, // the time to start the animation in frames
color_e: [7, 97, 7], // color of edges in RGB
color_v: Yellow, // set color of nodes, using the global Yellow variable
});
};
s.draw = function () {
s.background(0);
s.g.show(); // Manim.js classes usually define a show() function to be called in draw()
};
};
let p = new p5(GraphExample); // creates the p5 object to render the animation
PS: I created Manim.js in 2018 because I could not get manim to work at the time. I chose p5.js since I was greatly inspired by the Coding Train who made hundreds of wonderful videos with p5.js.
Jelajahi proyek terkait
Memuat…