Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Mojulo – Pixelated Math Rendering Sandbox Toy (maxbittker.github.io)
50 points by pokpokpok on Oct 4, 2014 | hide | past | favorite | 37 comments




This is freaking awesome.


I like the time element! A friend from my old days got really into algorithmic art (http://dahart.com/paper/hart_evomusart_2007_paper.pdf) you should consider including exp/ln and others. He's got some nice examples on his webpage (http://dahart.com/blot1.html).


Thanks, these are inspiring. Makes me want to add genetic mechanics.


Here is a basic thobber:

  ((cos(time/2)+1)*x)+((cos((time-(3.141*2))/2)+1)*(100-x))
https://maxbittker.github.io/Mojulo/#KChjb3ModGltZS8yKSsxKSp...

Here is using the same trick to switch between two patterns:

  ((cos(time/50)+1)*(A*1000))+((cos((time-(3.141*50))/50)+1)*((x-50)^2+(y-50)^2))
https://maxbittker.github.io/Mojulo/#KChjb3ModGltZS81MCkrMSk...

Unfortunately, this trick doesn't work well with patterns with high values, and thus most animated patterns don't work.

It works like this:

  ((cos(time/p)+1)*q)+((cos((time-(3.141*p))/p)+1)*Q)
where: p is the speed of the switch (Higher is slower), q is pattern #1, and Q is pattern #2.

The cos(...)+1 part in both sections is in charge of timing. In the second part we subtract pi * p, which is half the period, from time to make it start at the half point of the cycle.


thanks, I appreciated this


This is very similar in style to IBNIZ: http://pelulamu.net/ibniz/ which also does audio.

There used to be a JS implementation hosted at http://ibniz.asiekierka.pl/ibniz.html but the domain seems to have expired. The Wayback Machine has a copy though: https://web.archive.org/web/20120121060156/http://ibniz.asie...


Very fun, and the gallery is a nice touch. Here's my contribution:

  (r *(2*sin((-A*time)/10))^100)  * ((r * r ) % 2)
http://maxbittker.github.io/Mojulo/#KHIgKigyKnNpbigoLUEqdGlt...


Thought this came out pretty well:

http://maxbittker.github.io/Mojulo/#cip0aW1lKih0aW1lKnNpbih4...

Speeding it up (increase the first "time" to "time^9") you can see that it eventually "heats up" all the way to black, but it's a nice journey.

Edit: also this one has a nice strobe. You can strobe any pattern you make by replacing a time with some variant of B*sin(time/C) where B and C are appropriately chosen coefficients.

https://maxbittker.github.io/Mojulo/#MTAwKnNpbih0aW1lLzEwKSp...


Nice! After playing with it for a bit too long, this was my favourite:

    sin(time * 0.2) * cos(time * 0.1) * (125+125*sin(0.01*(2 + sin(0.6*time)*cos(0.4*time))*((- 50 + x + 20 * cos(0.5*time))^2 + (- 50 + y + 20 * sin(0.3*time))^2)))


Neat! Haven't teased anything like this out of it yet so thanks for sharing, I'll add it to the gallery. Linking works by the way:

https://maxbittker.github.io/Mojulo/#ICAgIHNpbih0aW1lICogMC4...


zoomy checkerboard by summing a few sinusoids

http://maxbittker.github.io/Mojulo/#NDAqKHNpbigoeC01MCkvKDQr...


Behavior becomes more interesting if you replace (in any formula) time with (time+sin(time)) - and, more generally, with (time+ksin(wtime))


I encourage people to check out and contribute to the gallery, I built this because I wanted to see the amazing things people come up with!


Fan like+circling around with a long period http://maxbittker.github.io/Mojulo/#c2luKCh5KmNvcyh0aW1lLzIx...


neat, can't quite grok the mechanics behind it though


Fan is (y-50)/(x-50)+time/5, sin is to add texture. Multiplying x by cos and y by sine of the same frequency would simply rotate the fan centre around top right corner, slightly off periods (19 and 21) degenerate that circle into a more interesting Lissajous curve.


thanks for breaking it down! I'm adding it to the snazzy new gallery, and implementing Lissajous curves is going to be my new region of exploration


here's one:

  10*((((100-x)^2+y^2)^0.5 + time) % 10) + 10*((((x)^2+y^2)^0.5 + time) % 10)


linked for the lazy:

https://maxbittker.github.io/Mojulo/#ICAxMCooKCgoMTAwLXgpXjI...

fantastic effect! One of my favorites today, thank you. Quick question - do you think that I should refine the gallery formatting to include attribution? It's a bit of a "discovery vs invention" type quandary


Just wanted to mention, that gallery link is barely noticeable because of the blue color. I didn't notice it on multiple visits till you mentioned there was a gallery.

Changing the link color should fix it.


haha it's always been purple for me because it's a clicked link! no wonder nobody can find it. thank you





This looks kind of cool:

rand()/rand() * cos(time)^2 * 127

and

rand()/rand() * cos(time/rand())^2 * sin(time/rand())^2 * 127



Very cool! If you combined this with something like blockly[0] I bet it'd inspire quite a few kids.

[0]: https://code.google.com/p/blockly/


good idea! this project was partially inspired by math classes spent in high school plotting pretty polar functions on my graphing calculator instead of paying attention to trigonometry... I'm not sure that mojulo in it's current form will be a useful educational tool but I think that toys similar to this are a great way to impress upon kids a sense of different functions they usually only encounter on paper


I've been CNCing algorithmic output a lot lately. I write something very similar (no time component, but basically evaluated over the unit square.)

This stuff is a ton of fun!


(sin(-x * y) / cos(x * -y)) ^ (time % (r + A))


kinda psychedelic -- stare at it for a while:

http://maxbittker.github.io/Mojulo/#MjUwICogKCgoKCh4LTUwKV4y...


sin(r/x) * y * time^2+rand()^y is a nicely non-repeating result


x * y * (sin(x+time) * cos(y+time) * time/2)



More constant tweaking:

x * y * (sin((x+time)/5) * cos((y+time)/5)) * 15 + 3000

http://maxbittker.github.io/Mojulo/#IHggKiB5ICogKHNpbigoeCt0...


Nice.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: