p5.js for easy 2D and 3D graphics and more

Written on July 28, 2017

Since JATOS doesn’t limit what actually runs in the browser during your studies you can use all kinds of JavaScript libraries and frameworks with it. This is not possible if you use e.g. Qualtrics. One of those libraries is p5.js. p5.js lets you do otherwise complicated 2D or 3D graphics in an easy way. Have a look at the examples on the p5.js webpage to get an idea of what is possible.

Some features of p5.js:

  • 2D and 3D shapes (including bezier curves and polygons)
  • Image calculations
  • Video and sound support
  • Webcam or mic capture
  • Math helper functions
  • Interaction with mouse and keyboard
  • Particle systems
  • Basic physics

Another example of what one can do is net-glimpse (coincidentally written by me) which uses p5.js together with Toxiclibs.js for the visualization of network traffic in the browser.

And of course I did an example study with p5.js for JATOS.

Written on July 28, 2017 by Kristian Lange (lange.kristian@gmail.com)