Langton's Ant 3D - Three.js 🐜

In a 12h Hackathon a college and me did this 3D version of the Langton’s Ant universal Turing machine. The ant still moves in 2D, but you can hover its draft.
We hope it can make its way into the featured projects page :slight_smile: .



What an awesome forum this is! Learning knew things every day. As a creative artist concepts like Langton’s Ant are new to me. Looked it up! Thanks for sharing!

Great demo! Already spent way too much time playing with it. I like your shader and background choices.

You should give your self some “credits” on the page

Hope to see more awesome projects like this.

The demo doesn’t work now. Probably an incompatibility issue, as OrbitControls is updated, whereas three.js is locked to r101.

Thank you for the report!

It’s fixed now :tada:.

1 Like

That’s great! It looks cool. :+1:

If I may give some tips on improving the performance:

  1. floor.getObjectByName( '('+x+','+z+')' ) takes up 45.6 % of the time on my system, according to the profiler in Chrome. Object3D.getObjectByProperty conducts a linear search over a growing number of cells. Simply indexing the cells in a literal object would probably improve vastly over this as the number of cells grows. Even better would be to create an unambiguous ordering of the cells, such as a spiral pattern, that you can query directly. This would also help the next point:
  2. Some 32.9 % of the time are spent by the renderer. This is a job for instancing (see the examples), since all the cells differ only by simple values that can be transferred by instanced attributes. The only obstacle I can see is that you may eventually need to reallocate memory, that is rebuild the geometry. But this will be a rare event, as you can manipulate the active number of instances dynamically within the present limit.
1 Like

You are right, it goes much faster now! :rocket: I used Maps. Thank you so much!

Instancing looks quite complex :sweat_smile:. By now it has an acceptable frame rate, I’ll keep this improvement for later.

1 Like