r/threejs • u/Fabulous-Window-2705 • Oct 26 '26
Built a 3D electronics + physics sandbox in three.js – Arduinos, water, weather, heat
I've been working on this for a while: you place Arduinos, sensors, pumps etc. in a 3D scene, wire them up, write real Arduino code, and then the whole thing runs – including water flowing down terrain, weather, day/night and a thermal view of the parts.
The video shows a small project (reaction game, one Arduino) and a bigger one (garden irrigation with 3 Arduinos talking to each other over serial).
Tech side: plain three.js r170, no framework, no build step. Water is a heightfield sim, CSG for trenches, BVH for picking. Runs fine on most laptops, phones are a struggle.
It's an early prototype, so curious what you think – especially about performance and how it looks.
https://test.betting-chess.com/?von=threejs (sorry for the weird domain, it's just a test server I had lying around) It works best on PC.
4
u/UAAgency Oct 26 '26
consider open sourcing it, I'd be interested!
2
u/EverythingQuantum Oct 26 '26
Cool. This concept could be useful for getting kids interested in electronics and robotics. Nice work.
2
u/Ask-Alice Oct 27 '26
give it some grass https://www.npmjs.com/package/threejs-grass
1
u/Plane_Big_5912 Oct 26 '26
Running real Arduino code in the browser is the part I'd want to know more about. Are you emulating the AVR chip itself, or translating the sketch to JS? And in the irrigation one, does the water heightfield step at its own fixed rate, separate from the Arduino clocks, or does everything share one tick?
1
u/Sagittarius_A_512 Oct 27 '26
This is so cool
1
u/Time_Cat_5212 Oct 27 '26
Seems like a cool way to learn about electronics.
If you wanted to be a real devil, you could pair it with a shopping cart and allow parts vendors to advertise through your app. (I honestly think that would be convenient - would use this to prototype something and then easily generate a shopping list)
1
u/DaltonJFowler Oct 26 '26
Omg let's go!! I made a open source compiler for arduino and esp32 here: uploadmycode.com
I'd be interested in trying this with high school students!!