HOME | DD

Published: 2012-06-26 00:06:38 +0000 UTC; Views: 659; Favourites: 2; Downloads: 39
Redirect to original
Description
A curved version of the sierpinski triangle generated by doing some math on the pixels distance from the upper left and lower right corners. Celestia palate version.Related content
Comments: 4
uxyd [2012-07-04 00:00:28 +0000 UTC]
That's a really interesting effect. I've seen lots of sierpinski stuff, but never on a curved space like that.
👍: 0 ⏩: 1
deathblob In reply to uxyd [2012-07-04 00:13:20 +0000 UTC]
Thanks. I'll try to post how it works in more detail soon, the basic idea works for any number of points to compare. 3 and 6 provide good results.
👍: 0 ⏩: 1
deathblob In reply to deathblob [2012-07-04 01:19:39 +0000 UTC]
Hmm, I've run into the all too common spot were I know something works, but I don't know why. I'm using and working around quirks in the code language that Game Maker uses, so i'll have to do some double checking and such to figure out a general description. At worst I could always just put together a simple run-able example exe and the game maker code and put it in a zip file somewhere.
👍: 0 ⏩: 1
deathblob In reply to deathblob [2012-07-04 02:03:43 +0000 UTC]
Ok, so here is the basic idea: figure out how many points you want to warp around and were they are. Then on each pixel figure out the distance to point 1, then do a Bitwise OR on the distance to point 2, then if you have more points just keep taking the current value and do a Bitwise OR on the distance to the next point. z=distance_to_point(0,0)|distance_to_point(400,400) for example.
For a related pattern that scales up better to more points I think, do a Bitwise EXCLUSIVE OR for each part instead of OR. Like: z=distance_to_point(0,0)^distance_to_point(400,400)
Z is used as which sprite to draw from the sprite sheet gradients i've made from these: [link] You can also just use Z as a hue value or for RGB values of course.
The effects work best when you use points that are some distance apart from each other, like corners of the image or even values past the image boundaries, also points arranged in a circle work well.
👍: 0 ⏩: 0