r/node • • Aug 05 '20

Multi-user interactive visuals with nodejs and p5js (work in progress!)

458 Upvotes

25 comments sorted by

View all comments

2

u/oleic Aug 05 '20

wow this is cool :) is the visualization also synchronized between the devices over network?

2

u/jaymeekae Aug 05 '20

Users get paired up in twos and then whenever one of them draws, it sends the new points to their partner. It sends the points' location, colour, direction, pen thickness etc. Then each client handles the animation from then on.

Rotation currently will get a bit out of sync due to differences in framerate on different machines, I'm thinking about how I could adjust rotation speed so it's based on millis somehow but need to experiment because it might be a huge faff, or it might make things jittery, not sure yet.