Show HN: Minimal 3D creative coding tool – control 8×8×8 dots with JavaScript

by doersinoon 4/28/2021, 7:01 PMwith 30 comments

by doersinoon 4/28/2021, 7:02 PM

Repeatedly click the dots for a tutorial, click and drag to rotate, and – after writing a function of your own – hit "enter" to generate a shareable URL!

The source code can be found here: https://github.com/doersino/tixyz

Let me be clear: This thing is wholly derivative, merely adding a third dimension to Martin Kleppe's excellent creative code golfing tool tixy [0] (which you should definitely check out if you find yourself liking this 3D variant of it) by mashing it up with David DeSandro's equally-excellent 3D library Zdog [1]. Those two deserve any and all credit.

[0]: https://tixy.land and previously discussed at https://news.ycombinator.com/item?id=24974534

[1]: https://zzz.dog and https://news.ycombinator.com/item?id=20036169

by chaosmachineon 4/29/2021, 7:04 AM

My best:

  tan(i*t/999)*(~~(t*24%7)==i%7)
https://doersino.github.io/tixyz/?code=tan%28i*t%2F999%29*%2...

Play with the frame rate ("24") for some interesting effects.

Edit: One more:

https://doersino.github.io/tixyz/?code=sin%28i*t%2F999%29*%2...

by yesenadamon 4/29/2021, 12:28 AM

This is so cool! Great job.

sin(i+t) : https://doersino.github.io/tixyz/?code=sin(i%2Bt)

If you stop that one rotating with the mouse, it's some kind of brain-damaging illusion. Or thousands of illusions, most of which do something weird to your eyes–it looks very different from different angles. Hmm that is such a great way of generating (2D) optical illusions!

by rjmunroon 4/29/2021, 9:45 AM

I think this would might better with a slight perspective transformation, at least for some effects - sometimes the 3d is hard to appreciate.

Also once you drag manually there is no way to put it back into auto-rotate mode. It would be great if there was a bit of momentum when you drag - it should carry on at the speed you dragged it.

by azhenleyon 4/29/2021, 2:55 AM

Inspired by tixy.land, I recently made a simple game engine with 16x16 animated “pixels”. We used it as an in-class activity during the last week of the semester.

https://github.com/AZHenley/wiggleface

by _Microfton 4/29/2021, 6:55 AM

Did you fix the bug in the tixy.land code where one could inject as much code as wanted via location.hash?

Here is the post from when I discovered it:

https://news.ycombinator.com/item?id=24980221

Edit: no, that still works, here is an example:

https://doersino.github.io/tixyz/?code=eval(%27%2F*%27%2Bpar...

by simlevesqueon 4/29/2021, 4:43 AM

Old ambulance light: https://doersino.github.io/tixyz/?code=%28Math.random%28%29%...

Edit: i just figured out that t is a float, I thought it was the seconds as an int.

Edit 2: if anyone reads this, try to make a barbershop type thing.

by schaeferon 4/29/2021, 4:25 AM

I love this project.

but also, if you are sensitive to flashing lights, this web page has 512 of them.

by gregmacon 4/29/2021, 6:55 AM

I've wanted to build a LED cube [1] for a while, but just haven't had the time to get to it yet. This is basically a virtual version of the same thing, very cool. And significantly simpler to experiment with before committing to several days of soldering.

[1] https://www.instructables.com/Led-Cube-8x8x8/

by panteliskon 4/29/2021, 5:47 AM

ha, awesome! I love how minimal the whole approach is

I call this, "Sweeping Vertigo" https://doersino.github.io/tixyz/?code=tan%28i%2Bt%29*random...

by quickthrower2on 4/30/2021, 10:28 PM

Jelly: Math.random(1)

https://doersino.github.io/tixyz/?code=Math.random(1)

by rsiqueiraon 4/29/2021, 10:33 PM

There can be a real-life 2D version of this: it probably can be integrated to an Arduino project using a LED 8x8 Red Dot Matrix Display (piece code MAX7219).