News for hackers. Stuff that matters.
Re:Why I prefer making useless stuff by beckingz on Monday May 24, 2021 @02:40AM (#27261611)
This is a nice butterfly.

How was it made?

Re:Why I prefer making useless stuff by andersource on Monday May 24, 2021 @02:54AM (#27261675)
Thanks!

First I'm generating the general geometry of the wings - the most basic shape is a "teardrop" / half of the infinity symbol (see this[0]). Then they are scaled and rotated randomly (within a range to match the other parts of the wings), and further perturbed to make the shape more random. Then I'm drawing lines from the "tip" of the teardrop to the edges and using them to color the segments. The final result is rendered with Three.js[1].

Obviously this is a very succinct explanation, it took me quite some work. You're welcome to look at the code[2], though it's quite messy :)

[0] https://en.wikipedia.org/wiki/Lemniscate_of_Gerono

[1] https://threejs.org/

[2] https://github.com/andersource/andersource.github.io/blob/ma...

Re:Why I prefer making useless stuff by beckingz on Monday May 24, 2021 @02:58AM (#27261695)
That's quite a lot of code! I wasn't expecting to see a linear interpellation function, but that would explain how smooth it looks.
Re:Why I prefer making useless stuff by pdm55 on Monday May 24, 2021 @06:12AM (#27262698)
I moved my cursor pointer around the screen and hoped it would follow.
Re:Why I prefer making useless stuff by andersource on Monday May 24, 2021 @07:14AM (#27263066)
That's a great idea!