Nature has the best algorithms, don't it folks? I have a question about a detail. The rule is: 1. When you see a nearby neighbour flash, nudge your own clock forward. 2. That's it. My question is -- when the fireflies are firing at the same time, they see each other flash, so they all nudge their clocks forward, correct? Assuming they don't nudge their clocks forward at the same amount, they would fall out of sync, c…
> If you see a neighbour nearby flash, when you are not flashing, nudge your clock forward by a bit. I think this is it. There could be some missing detail (e.g. a firefly is unable to "see" when it flashes) which keeps them from nudging their clocks once already in sync
Fireflies
51–60 of 93 posts
Re: Fireflies
#52What an extremely nice interactive read. Works good on mobile. And it applies the biological lesson to human life, which is a nice way to finish a sermon. Article. Well done.
Re: Fireflies
#53open source time to read
but with regard to say if it was a real-time rendered animation, then calculating the point of origin and affecting the nearby fireflies... hmm
the view clock part was particularly impressive though I could see it as a state thing, still so many of them on the same page, not crashing the browser or something interesting. Maybe I'm over thinking it.
edit: I didn't look at the scripts though below the canvas.
Re: Fireflies
#54Nature has the best algorithms, don't it folks? I have a question about a detail. The rule is: 1. When you see a nearby neighbour flash, nudge your own clock forward. 2. That's it. My question is -- when the fireflies are firing at the same time, they see each other flash, so they all nudge their clocks forward, correct? Assuming they don't nudge their clocks forward at the same amount, they would fall out of sync, c…
Nudge the clock "forward", not increase speed. So the overall frequency will be a little higher, but it won't keep on increasing
Re: Fireflies
#55I think the example works more quickly than it should due to the line "if(ff.clock>1) ff.clock=1;" Every time the clock goes over 1, wouldn't you mod the clock value, not set it to 1 exactly?
No, partly because fireflies take a certain amount of time to "charge" so jumping mid cycle might not be plausible physically. So what this line does (which is in the section of code where a flash alters the fireflies around it) is that after advancing the other fireflies clocks, if any are over 1 then it puts them in the right state to flash on the next time they're evaluated. If you mod it, then you would have the…
Re: Fireflies
#56Kind of curious how it works, when you inspect it, there's just a canvas, the fireflies don't seem to be individual, so no sense of "objects" or "individual entities" open source time to read but with regard to say if it was a real-time rendered animation, then calculating the point of origin and affecting the nearby fireflies... hmm the view clock part was particularly impressive though I could see it as a state thi…
Re: Fireflies
#57Kind of curious how it works, when you inspect it, there's just a canvas, the fireflies don't seem to be individual, so no sense of "objects" or "individual entities" open source time to read but with regard to say if it was a real-time rendered animation, then calculating the point of origin and affecting the nearby fireflies... hmm the view clock part was particularly impressive though I could see it as a state thi…
Canvas is pretty performant. WebGL is even more performant. You can easily have a few thousand things on the same page at a time.
Re: Fireflies
#58Earlier quoted context omitted.
Nudge the clock "forward", not increase speed. So the overall frequency will be a little higher, but it won't keep on increasing
Exactly. For anyone having trouble, just picture a pure sinusoidal signal, flash = sin(2π·freq·time + phase). Fireflies are changing their phase, not their frequency. Completely independent parameters.
Re: Fireflies
#59Parable of the polygons is extremely questionable. For one, it attempts to have its cake while eating it too, by pretending it's an abstract demonstration about choices while explicitly calling out to hot topics in diversity, implying a clear causal link. For another, the model involves discrete agents on a discrete grid making decisions based on their immediate 8 square neighborhood, with no persistence or hysteresi…
Re: Fireflies
#60Yay ncase did it again! Don't forget to (re)view his project on The Parable of the Polygons: https://news.ycombinator.com/item?id=8716538 Playable posts are amazing. Interactivity in texts is amazing. <3