p5.wasm

Addon library for p5.js written in Rust and compiled to WebAssembly. Reimplements common functions found in p5.js.

BSD-2-CLAUSE License

Downloads
10
Stars
26
Committers
2
p5.wasm - Latest Release

Published by limzykenneth almost 4 years ago

  • Document random_seed cf42ac2
  • Fix bug where some color functions cause color objects to be freed 486848b

https://github.com/limzykenneth/p5.wasm/compare/v0.3.0...v0.3.1

p5.wasm - 0.3.0

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)
  • Add utility function to convert from WASM Color to p5 Color 4447060
  • Complete color's API list e89bb57
  • Implement lerp_color 03c9d95
  • Implement almost all color related functions 5745cdb
  • Implemented RGB parts of p5.color 99dc996
  • Implement random and random_range functions 3fcf645
  • Fix bug where perlin noise size is not created correctly d5bf796
  • Merge branch 'master' of https://github.com/limzykenneth/p5.wasm 5e71cfc
  • Merge pull request #5 from limzykenneth/dependabot/npm_and_yarn/ini-1.3.8 a5cb875
  • Bump ini from 1.3.5 to 1.3.8 ca8b166
  • Add flexible public path resolve 9c9bf84
  • Implement color_mode ee35d4c
  • Read color mode from root object 3caeebe
  • Complete color to_string implementation and test de66192
  • Partial color toString test for value verification c73b363
  • Tentative partial implementation of color.toString() 1c333db
  • Modularise folder structure a0cd22a
  • Document noise_seed and noise_detail 6c63fe8

https://github.com/limzykenneth/p5.wasm/compare/v0.2.1...v0.3.0

p5.wasm - 0.2.1

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)
  • Include travis build status in README.md 7e13918
  • Document trigonometry functions in API.md 5003bab
  • Implement trigonometry functions 96d3076
  • Tweaking travis CI setup 53c742f
  • Updating dependencies and fixing build errors 1cb21c6
  • Update dependencies 2a47f18
  • Merge pull request #1 from limzykenneth/dependabot/npm_and_yarn/lodash-4.17.19 7fce1af
  • Bump lodash from 4.17.15 to 4.17.19 45543a3
  • Edit CDN link to point to latest version 7bcef21
  • Add banner image to README fe0ac67
  • Add release step 0134d4a

https://github.com/limzykenneth/p5.wasm/compare/v0.2.0...v0.2.1

p5.wasm -

Published by limzykenneth over 4 years ago

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)
  • Document vector functions 13a9962
  • Use reference instead of taking ownership of arguments b466ba2
  • Expose Vector constructor to js 1849096
  • Trying to fix 2fb3307
  • Try switching language 2b9fb63
  • Retrying install wasm-pack on CI 7d919cd
  • Install wasm-pack on CI 3d54b69
  • Build wasm before install on CI 4177695
  • Add CI testing f57dc0e
  • Add tests for vector abc1999
  • Implement rest of vector prototype functions 32afe19
  • Add some vector functions 78d3a84

https://github.com/limzykenneth/p5.wasm/compare/0.1.1...v0.2.0

p5.wasm - v0.1.1

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

p5.wasm - v0.1.0

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)