Training brainjs to build 3D environments in threejs

Over the Easter break I had time to play with brainjs to help automatically create interior designs for wine cellars (Kitchens are on the way…)

Here’s what I learned…

  • AI is no magic bullet. I only trained on a very limited number of products and yet the training took longer than the programming. So rather than being a “time saver” it just means the programmer has to use all the time instead of the end user!! I’m sure there must be a formula for this. :thinking:

  • AI is great at recognizing and regurgitating patterns, but you basically have to feed it integers and you get integers back, so you still need to map these to real world scenarios (i.e. as threejs developers we are not superfluous yet!)

  • AI is stupid. It uses a brute force approach to the very simplest of tasks. In my program, using the undo/redo, I can see the order in which it creates these designs and it’s absolutely nuts!

  • AI is magic. I fed it things I didn’t expect it to understand and somehow it still came out with the right answer. For example it can find out whether a point lies within a polygon, without doing any actual 3D math. You just feed it points and polygons, tell it which ones are right and wrong and within a few examples it figures it out. I lost some sleep that night.

  • Teach offline, deploy online. I’m lucky enough to have a RTX 3090 in my office. I’m using it for training my models. If I wanted to do that on a server (which would be a lot more convenient), I’m looking at $255 a month for the same setup. ( If anyone knows a cheaper way, I’d be glad to hear it.

  • DON’T try training on your normal server (CPU). I managed to take out 8 other nodejs applications that were running on mine. Luckily I got them up again before any clients noticed.

There’s a lot of potential here, but keep an eye on the hours. I admit I’m still a complete novice when it comes to AI, and I wouldn’t have got anywhere without the assistance of ChatGPT to write my AI program :slight_smile:

Brainjs is a great place to start, but I’m now moving to Tensorflow. More complicated to set-up and train, but seems to have more options. Looks like I’ll have to learn python to get the best performance.

If anyone knows of any useful resources I’d be very glad to find some! Perhaps we can start some here? Everything I read seems to be about large language models or image recognition (computer vision, etc.), which I then have to try and extrapolate for actual 3D operations.

In the long run we’re all doomed, but for now it’s (arguably) the most fun you can have with your computer.

As 3D developers, what do you guys think about AI generally? Is it coming for our jobs, or is it the best thing that’s happened since Away3d? (showing my age there)


A few resources I found useful…

Build your own Neural Network, without a library.

Simple, but very informative.

Great teacher, although it’s an older version.

Thanks. Bookmarked. Will give brain.js a try.

1 Like