Openmosaic is an experimental framework that allows you to run processing sketches across multiple browser clients. Openmosaic makes use of the fantastic p5js library and nodejs to make this happen.
- Clone this repo -
git clone https://github.com/lonesword/openmosaic.git
cd
into the cloned directorynpm install
node server.js -c config_example.json -s examples/wave_example.js
- Open 4 tabs in the browser and point them to the appropriate screen URLs (see here )
Usage: -c <config file> -s <sketch file>
Options:
--help Show help [boolean]
--version Show version number [boolean]
-c, --config Path to config file [string] [required]
-s, --sketch Path to sketch file [string] [required]
-
Your p5.js sketch must call
mosaicInit();
from insidesetUp()
. Refer to any of the bundled examples. -
Create a corresponding config.json file. Keys should be your screen names and each screen should specify an origin. Here is an example config:
{
"my_screen_1": {
"origin": [0, 0]
},
"my_screen_2": {
"origin": [-440, 0]
},
"alice_screen": {
"origin": [0, -280]
},
"bob_screen": {
"origin": [-440, -280]
}
}
This indicates that you wish the sketch to be run across 4 clients - my_screen_1
, my_screen_2
, alice_screen
and bob_screen
-
Start the server by running
node server.js -c <config_file> -s <your_sketch_file>
-
To load a screen, point the browser to
http://localhost:3000/screen/<screen_name>/
. For example, to viewalice_screen
, point your browser tohttp://localhost:3000/screen/alice_screen/
. -
Open a tab and go to
http://localhost:3000/start/
(or hit that URL from the terminal using CURL - it's a simple GET request) to "start" the sketch.