Addon library for p5.js written in Rust and compiled to WebAssembly. Reimplements common functions found in p5.js.
BSD-2-CLAUSE License
https://github.com/limzykenneth/p5.wasm/compare/v0.3.0...v0.3.1
Published by limzykenneth almost 4 years ago
New Functions
p5.wasm | p5 |
---|---|
wasm.color(r, g, b, a) |
color(r, g, b, a) |
wasm.red(c) |
red(c) |
wasm.green(c) |
green(c) |
wasm.blue(c) |
blue(c) |
wasm.alpha(c) |
alpha(c) |
wasm.hue(c) |
hue(c) |
wasm.saturation(c) |
saturation(c) |
wasm.brightness(c) |
brightness(c) |
wasm.lightness(c) |
lightness(c) |
wasm.lerp_color(c1, c2, amt) |
lerpColor(c1, c2, amt) |
wasm.color_mode(mode) |
colorMode(mode) |
Color.to_string([format]) |
Color.toString([format]) |
Color.set_red(red) |
Color.setRed(red) |
Color.set_green(green) |
Color.setGreen(green) |
Color.set_blue(blue) |
Color.setBlue(blue) |
Color.set_alpha(alpha) |
Color.setAlpha(alpha) |
fromWasmColor(wasm_color) |
N/A |
wasm.random() |
random() |
wasm.random_range(min, max) |
random(min, max) |
wasm.random_seed(seed) |
randomSeed(seed) |
https://github.com/limzykenneth/p5.wasm/compare/v0.2.1...v0.3.0
Published by limzykenneth about 4 years ago
New Functions
p5.wasm | p5 |
---|---|
wasm.acos(value) |
acos(value) |
wasm.asin(value) |
asin(value) |
wasm.atan(value) |
atan(value) |
wasm.atan2(y, x) |
atan2(y, x) |
wasm.cos(angle) |
cos(angle) |
wasm.sin(angle) |
sin(angle) |
wasm.tan(angle) |
tan(angle) |
wasm.degrees(radians) |
degrees(radians) |
wasm.radians(degrees) |
radians(degrees) |
https://github.com/limzykenneth/p5.wasm/compare/v0.2.0...v0.2.1
New Functions
p5.wasm | p5 |
---|---|
wasm.create_vector() |
createVector() |
wasm.create_vector_1d(x) |
createVector(x) |
wasm.create_vector_2d(x, y) |
createVector(x, y) |
wasm.create_vector_3d(x, y, z) |
createVector(x, y, z) |
Vector.to_string() |
Vector.toString() |
Vector.set_vector(vector) |
Vector.set(vector) |
Vector.set_1d(x) |
Vector.set(x) |
Vector.set_2d(x, y) |
Vector.set(x, y) |
Vector.set_3d(x, y, z) |
Vector.set(x, y, z) |
Vector.copy() |
Vector.copy() |
Vector.add_vector(vector) |
Vector.add(vector) |
Vector.add_1d(x) |
Vector.add(x) |
Vector.add_2d(x, y) |
Vector.add(x, y) |
Vector.add_3d(x, y, z) |
Vector.add(x, y, z) |
Vector.sub_vector(vector) |
Vector.sub(vector) |
Vector.sub_1d(x) |
Vector.sub(x) |
Vector.sub_2d(x, y) |
Vector.sub(x, y) |
Vector.sub_3d(x, y, z) |
Vector.sub(x, y, z) |
Vector.mult(n) |
Vector.mult(n) |
Vector.div(n) |
Vector.div(n) |
Vector.mag() |
Vector.mag() |
Vector.mag_sq() |
Vector.magSq() |
Vector.dot_vector(vector) |
Vector.dot(vector) |
Vector.dot_1d(x) |
Vector.dot(x) |
Vector.dot_2d(x, y) |
Vector.dot(x, y) |
Vector.dot_3d(x, y, z) |
Vector.dot(x, y, z) |
Vector.cross(vector) |
Vector.cross(vector) |
Vector.dist(vector) |
Vector.dist(vector) |
Vector.normalize() |
Vector.normalize() |
Vector.limit(max) |
Vector.limit(max) |
Vector.set_mag(n) |
Vector.setMag(n) |
Vector.heading() |
Vector.heading() |
Vector.rotate(a) |
Vector.rotate(a) |
Vector.angle_between(vector) |
Vector.angleBetween(vector) |
Vector.lerp_vector(vector) |
Vector.lerp(vector) |
Vector.lerp_1d(x) |
Vector.lerp(x) |
Vector.lerp_2d(x, y) |
Vector.lerp(x, y) |
Vector.lerp_3d(x, y, z) |
Vector.lerp(x, y, z) |
Vector.array() |
Vector.array() |
Vector.equals_vector(vector) |
Vector.equals(vector) |
Vector.equals_1d(x) |
Vector.equals(x) |
Vector.equals_2d(x, y) |
Vector.equals(x, y) |
Vector.equals_3d(x, y, z) |
Vector.equals(x, y, z) |
https://github.com/limzykenneth/p5.wasm/compare/0.1.1...v0.2.0
Published by limzykenneth almost 5 years ago
New functions:
p5.wasm | p5 |
---|---|
wasm.noise(x) |
noise(x) |
wasm.noise2d(x, y) |
noise(x, y) |
wasm.noise3d(x, y, z) |
noise(x, y, z) |
wasm.dist3d(x1, y1, z1, x2, y2, z2) |
dist(x1, y1, z1, x2, y2, z2) |
wasm.round(n) |
round(n) |
wasm.round_decimal(n, decimal) |
round(n, decimal) |
Fix bug in wasm.constrain
Published by limzykenneth almost 5 years ago
First release of p5.wasm. Added functions:
wasm.abs(n)
→ abs(n)
wasm.ceil(n)
→ ceil(n)
wasm.constrain(n, low, high)
→ constrain(n, low, high)
wasm.dist(x1, y1, x2, y2)
→ dist(x1, y1, x2, y2)
wasm.exp(n)
→ exp(n)
wasm.floor(n)
→ floor(n)
wasm.lerp(start, stop, amt)
→ lerp(start, stop, amt)
wasm.log(n)
→ log(n)
wasm.mag(x, y)
→ mag(x, y)
wasm.map(n, start1, stop1, start2, stop2, [withinBounds])
→ map(n, start1, stop1, start2, stop2, [withinBounds])
wasm.norm(n, start, stop)
→ norm(n, start, stop)
wasm.pow(x, y)
→ pow(x, y)
wasm.sq(n)
→ sq(n)
wasm.sqrt(n)
→ sqrt(n)