Skip to content

About

Space Art Installation using p5js and Websocket. User can draw and submit to project it onto bigger screen.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

🚀 Space Art p5js Websocket

A creative coding installation using p5.js and WebSocket. Visitors draw and color space-themed objects on their devices, then submit them to a shared projection. Drawings from multiple users (touch devices supported) are synchronized in real time and remain on the projection until the projection page is refreshed or closed.

Try it now

Draw and Project

Draw and Project

Animated Projection

Animated Projection

✨ Inspiration

Not long ago, I visited an installation by LZY Visual, an interactive media studio. Their installation allowed visitors to draw space-themed objects (using real paper and crayons), scan them, and see their drawings projected onto a wall as part of an interactive scene.

Inspired by that experience, I created a web-based version using p5.js and WebSocket, where participants can draw on their own devices and instantly send their creations to a shared projection in real time.

Art Installation

Big Wall
Detailed Wall

Coding

🏋️ Challenges & Solutions

1. Coding References

Challenge: It's been a long time since I make something in p5js, and this project use of a lot of p5js functions and parameters.

Solution: I had to jump into p5js reference site a lot to know how to do certain things.

2. Connect draw and projection sketch using Websocket

Challenge: Back in the days I only make an art per an index.html, and this project need to be run on different devices (at least 1 for drawing and 1 for projection).

Solution: Watching The Coding Train's video about websocket.

3. Assets collection

Challenge: In this typical of project, I don't want to use AI generated art.

Solution: Jump into free-royalty asset sites like pixabay (for audio), vecteezy and flaticon (for drawing template). Also because the drawing templates are transparent, I had to fill the proper area of each template into white in Photopea so the default result has a baseline color.

4. Package / libraries

Challenge: Usually, CDN is just enough for typical p5js projects, but this project need to be run on a server due to how Websocket works. Also, it turned out p5js is a little bit extra.

Solution: I ask LLM, they tell me to use combination of npm packages for express and socket.io, while using downloaded p5.min.js for p5js.

5. Deploy to Railway

Challenge: It runs on my localhost, why not in the production?

Solution: Adjust PORT configuration in server.js and change io.connect() within both sketch.js (draw and projection sub-folder). Thanks to LLM.

⚙️ Tech Stack

  • p5js - a friendly tool for learning to code and make art
  • Node.js - a free, open-source, cross-platform JavaScript runtime environment
  • Express.js - Node.js web application framework
  • Socket.IO - bidirectional and low-latency communication for every platform

About

Space Art Installation using p5js and Websocket. User can draw and submit to project it onto bigger screen.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages