Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Using Prime Numbers to Generate Backgrounds

Unknown Lamer posted more than 3 years ago | from the insects-are-surprisingly-good-at-design dept.

Graphics 180

bpeh123 pointed out an article about generating organically tiled backgrounds inspired by the life cycle of cicadas. The trick is to overlay multiple background tiles with prime widths thus generating a series that does not repeat for a sufficiently long period. This introduces a seeming irregularity and makes the background appear much more natural.

Sorry! There are no comments related to the filter you selected.

Let me be the first to say... (2, Interesting)

multipartmixed (163409) | more than 3 years ago | (#35748534)

...NEEEEEEieieiirrrnngngne eEEEEEEEEEEee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeernrng!

Re:Let me be the first to say... (1)

Anonymous Coward | more than 3 years ago | (#35748706)

Coach Z?

Re:Let me be the first to say... (0)

Anonymous Coward | more than 3 years ago | (#35749324)

If anyone wooshed @ the parent, I can tell you the exact the episode and anime names where that particular cicada sample went for the soundrack.
You're welcome.

Re:Let me be the first to say... (0)

Anonymous Coward | more than 3 years ago | (#35749430)

What anime? Hayate no Gotoku?

Re:Let me be the first to say... (1)

EdZ (755139) | more than 3 years ago | (#35749946)

The correct answer is: EVERY anime. That same damn cicada sound effect is like the Wilhelm Scream of Japan.

Re:Let me be the first to say... (1)

mwvdlee (775178) | more than 3 years ago | (#35750884)

It's a nice idea.
Too bad it's not supported by the majority of browsers.
Try again in a few years, when all IE6-using companies have finally upgraded to IE7.

Fuck you slashdot (2, Informative)

Anonymous Coward | more than 3 years ago | (#35748652)

Why can I only check Post Anonymously when I post a new comment but not a reply? Also, it would be kinda cool if I could click on fucking links again without having to triple right click and then open in a new window.

Re:Fuck you slashdot (0)

thePowerOfGrayskull (905905) | more than 3 years ago | (#35748736)

Probably because you haven't yet learned the intricacies of the "web browser", the "mouse" and quite possibly "the computer". Orrrr... you're somehow being served up a different version of slashdot than the rest of us.

Re:Fuck you slashdot (2, Insightful)

spun (1352) | more than 3 years ago | (#35748884)

He's not the only one, bucky. No need to be an ass. I don't have the problem with the post anonymously checkbox, but I have not been able to click on any off-site links for a week, using Firefox 3.6.16. Internet Exploder works, but I'm not using that POS.

Re:Fuck you slashdot (3, Insightful)

MozeeToby (1163751) | more than 3 years ago | (#35750318)

The new UI has been getting more buggy every week rather than less buggy. Off site links not working, clicking 'score' to view how things are moderated collapsing the comment, scrolling issues, clicking anywhere on the comment navigating to the parent, weird highlighting when submitting a comment... and that's just off the top of my head and coming from someone who was initially supportive of the changes. All on FF4.0

Re:Fuck you slashdot (2)

gstoddart (321705) | more than 3 years ago | (#35748992)

Probably because you haven't yet learned the intricacies of the "web browser", the "mouse" and quite possibly "the computer". Orrrr... you're somehow being served up a different version of slashdot than the rest of us.

Maybe you are oh-so-lucky as to have Slashdot behave consistently and predictably lately.

Half of the time when I go to meta-moderate, the +/- buttons don't do anything at all -- they're inert, and clicking on them doesn't do anything. Sometimes, if I browse away and come back, it works. Sometimes it doesn't work for days. I mean, I would expect the behavior of a web page to be deterministic but apparently that's not the case.

It's been making me go "WTF" for a couple of weeks now. I've even reverted to the oldest-school layout because some of the stuff was acting even weirder.

It's hard not to conclude there are some things on Slashdot that are working intermittently, and not in ways you might always predict.

Dial it back ... he's not the only one seeing Slashdot behave somewhat flaky of late.

Re:Fuck you slashdot (1)

Hognoxious (631665) | more than 3 years ago | (#35749596)

I've even reverted to the oldest-school layout because some of the stuff was acting even weirder.

Me too, but it still doesn't work properly on a small screen. You get a tiny strip of text between two big white borders, and the stuff at the top all overlaps each other.

It's like Roseanne Barr in a thong.

Re:Fuck you slashdot (1)

gfreeman (456642) | more than 3 years ago | (#35749952)

He's not the only one. Using Chrome, I have not been able to check the "AC" box this week.

Re:Fuck you slashdot (1)

zero0ne (1309517) | more than 3 years ago | (#35750490)

Ditto as well Chrome @ 11.0.696.16 beta

Re:Fuck you slashdot (0)

Anonymous Coward | more than 3 years ago | (#35749026)

I can also only post anonymously, but it has to do with being behind a corporate proxy. As soon as I log in and hit refresh or click to another page, I'm logged out again.

Re:Fuck you slashdot (0)

Anonymous Coward | more than 3 years ago | (#35749620)

Can't post replies anonymously to posts?

I want... (1)

H0p313ss (811249) | more than 3 years ago | (#35748670)

... whatever that dude is smoking.

OMG Sicadas are illuminati (1)

slackzilly (2033012) | more than 3 years ago | (#35748680)

"..While this is a rather rockâ(TM)nâ(TM)roll ending for our nerdy cicada, it raises an obvious question: Is it just by chance that they adopted 7, 11, or 13-ââyear life cycles, or are those numbers somehow special?" Those numbers always come up in conspiracy theories.

Re:OMG Sicadas are illuminati (1)

slackzilly (2033012) | more than 3 years ago | (#35748776)

wft? that looked allright in the preview.

Re:OMG Sicadas are illuminati (3, Informative)

Gordonjcp (186804) | more than 3 years ago | (#35748858)

Yes, some characters do. The Slashdot Janitors have decreed that only 7-bit ASCII can be used on the site and everything else should be presented in as broken a way as possible.

Because obviously, we're geeks so we're all using 30-year-old ADM3A terminals.

Re:OMG Sicadas are illuminati (1)

Nefarious Wheel (628136) | more than 3 years ago | (#35750808)

Hey, I really liked the ADM3A I built from Heathkit!

1 is the loneliest (non-prime) number (0, Informative)

Anonymous Coward | more than 3 years ago | (#35748700)

From TFA:

They’re all prime numbers—numbers that can only be divided by themselves and 1 (that is,1, 2, 3, 5, 7, 11, 13, 17, 19, 23, and so on).

FAIL. 1 is not prime.

Re:1 is the loneliest (non-prime) number (0)

Anonymous Coward | more than 3 years ago | (#35749420)

What two whole numbers besides one and itself can be multiplied to result in 1?

Re:1 is the loneliest (non-prime) number (2)

Hognoxious (631665) | more than 3 years ago | (#35749626)

One is itself, so it only has one factor. Really.

Re:1 is the loneliest (non-prime) number (3, Informative)

maxwell demon (590494) | more than 3 years ago | (#35749804)

Primes have, by definition, exactly two factors. 1 has only one: 1.

Of course, you could define them differently, and a hundred years ago, 1 indeed was considered a prime. But the definition excluding 1 has turned out to be much more useful (because almost everywhere you use primes you'd have to add "except 1" otherwise), therefore 1 is no longer considered prime.

Re:1 is the loneliest (non-prime) number (1)

toastar (573882) | more than 3 years ago | (#35749716)

But 1 is happy [wikipedia.org]

Re:1 is the loneliest (non-prime) number (0)

Anonymous Coward | more than 3 years ago | (#35749800)

I've never understood why not, other than definitional fiat.

And as far as this technique... I'm pretty sure that everybody with half a clue has been using this or a similar technique for the last 20 years (including in certain standard random number generators). I think this is just a new discovery for this particular author. At least he didn't try to patent it!

Re:1 is the loneliest (non-prime) number (1)

pjt33 (739471) | more than 3 years ago | (#35750514)

It's rather convenient to be able to say that every natural number has a unique factorisation. It allows you, for example, to take products over the factorisation (e.g. Euler's totient function phi(n) = n * PROD_p|n (1-1/p) which would have to be a product over "p|n AND p>1").

1 is not prime (3, Insightful)

PriNT2357 (1742498) | more than 3 years ago | (#35748718)

They can't even quote an article they link to properly
Their article: "that is,1, 2, 3, 5, 7, 11, 13, 17, 19, 23, and so on"
Wikipedia: "2, 3, 5, 7, 11, 13. . ."

Re:1 is not prime (1)

swanzilla (1458281) | more than 3 years ago | (#35748778)

True. One is divisible by one and one...primes require distinctness of divisors. Nice catch.

Re:1 is not prime (1)

Anonymous Coward | more than 3 years ago | (#35749072)

*sigh* ... All prime numbers are divisible by themselves.

Re:1 is not prime (2)

jank1887 (815982) | more than 3 years ago | (#35749122)

yes, but dividing by themselves gives 1 and dividing by 1 gives themselves, hence distinctness of divisors.

Re:1 is not prime (0)

Anonymous Coward | more than 3 years ago | (#35749534)

But they sighed! That means they know everything about the subject! Don't even try and correct them!

1 is a prime. (1, Informative)

Cyberax (705495) | more than 3 years ago | (#35749134)

There are two schools of thought, one considers 1 to be a prime (since its divisors are "1" and itself) the other school of thought doesn't. Some proofs work nicer if 1 is considered to be a prime, some proofs don't.

So it's just a matter of opinion.

Re:1 is a prime. (1)

janisozaur (1465907) | more than 3 years ago | (#35749372)

I don't deal with primes every day, but I have yet to see something (article, piece of code, school book, ...) that says that 1 is a prime. Please point me to one.

Re:1 is a prime. (1)

maxwell demon (590494) | more than 3 years ago | (#35749820)

Today, 1 isn't a prime. But 1912, it was. [oeis.org]

goddamit, you've broken reality again! (1)

Thud457 (234763) | more than 3 years ago | (#35749976)

You got truthiness in my mathematics!
This will not do. Oh no, no, no, no, no.

Re:1 is a prime. (1)

Tynin (634655) | more than 3 years ago | (#35750046)

Today, 1 isn't a prime. But 1912, it was. [oeis.org]

I will admit to not having much knowledge about the history of our pursuit of prime numbers, but I'm at a loss about the page you linked to. I understand where 1 could be considered a prime, but that list also includes numbers 4, 10, 12, 14, etc on that same list of primes. What school of thought would consider those prime? I'm genuinely curious, because I feel like I must be missing something obvious.

Re:1 is a prime. (0)

Anonymous Coward | more than 3 years ago | (#35750132)

1, 2, 3, 4, 5, 7, 10, 11, 12, 14, 15, 18, ... (the linked-to OEIS sequence) is the "old-fashioned" version of "x such that 1+3x(x-1) is prime". That is, 1+3*1*(1-1)=1, 1+3*2*(2-1)=7, 1+3*3*(3-1)=19, 1+3*4*(4-1)=37, etc. The first entry (1) should be omitted, since 1+3*1*(1-1)=1 is no longer considered a prime.

Re:1 is a prime. (1)

maxwell demon (590494) | more than 3 years ago | (#35750194)

Sorry, I should have linked to http://oeis.org/A008578 [oeis.org] (although it doesn't mention the year 1912).

Re:1 is a prime. (1)

Jake Griffin (1153451) | more than 3 years ago | (#35750626)

It also doesn't include 13 or 17. That's because that list is "numbers such that 1+3x(x-1) is a 'cuban' prime" and not a list of prime numbers.

Re:1 is a prime. (1)

neumayr (819083) | more than 3 years ago | (#35749452)

Well, I'd call it convenience instead of opinion. If you find a proof that works when 1 isn't prime, would you really start over to find a proof that works regardless, or would you just publish and call it a day? Or vice versa.
I don't know if it's possible that something that can be proven one way can't be proven the other way, but I'm sure there's a proof for that.

Re:1 is a prime. (3, Informative)

Anonymous Coward | more than 3 years ago | (#35750094)

A lot of proofs in recursion / computability theory actually depend on the fact that one is not a prime number. More specifically, they depend on the property of numbers that is called unique factorisation into primes, a very important theorem in mathematics that is a corner stone for many proofs in a variety of mathematical disciplines. If you count 1 as a prime number, this theorem does not hold, with all the consequences that you might suspect it entails.

Just sayin'. 1 is not a prime number.

Re:1 is a prime. (1)

SuperRenaissanceMan (1027668) | more than 3 years ago | (#35749988)

There are two schools of thought

one of which is correct

Re:1 is a prime. (1)

nullCRC (320940) | more than 3 years ago | (#35750146)

Nice pun.

Re:1 is a prime. (1)

Jake Griffin (1153451) | more than 3 years ago | (#35750644)

So, you're saying that a prime number of said schools of thought is correct then?

Re:1 is a prime. (4, Informative)

ObsessiveMathsFreak (773371) | more than 3 years ago | (#35750204)

This is in fact true.

The best reason for leaving one out of the prime number set is because it enables you to state the prime number theorem more succinctly:

Every integer n>1 has a unique factorisation as a product of primes (Prime factorisation)

If one was prime, then the factorisation would not be unique. For example 6=2.3, but if 1 was an allowed prime then 6=1.2.3=1.1.2.3=1.1.1.2.3= .... 1^n .2.3. So it's preferred to leave one out.

There are other reasons, but the prime number theorem is perhaps the best one.

Re:1 is not prime (0)

Anonymous Coward | more than 3 years ago | (#35749608)

Fun: Google "Is 1 prime", first two results are "Why 1 is Prime" and "Why is the number one not a prime?".

We were taught that 1 is a prime (1)

queenb**ch (446380) | more than 3 years ago | (#35750216)

While it is isn't correct, I do recall being told in school that one is a prime because it is only divisble by itself.

Other applications. (4, Interesting)

Toze (1668155) | more than 3 years ago | (#35748726)

Cool. I've looking at automatically generating stuff for games recently. Obviously, this works for authentic-looking backgrounds, but my friends and I were working on a project that involved automating critter generation using classic predator-prey models. One big worry was the farming-to-death of critters that are part of an ecosystem. This idea might be useful for much more nicely randomized or randomized-seeming mob population/spawning.

Re:Other applications. (2)

jank1887 (815982) | more than 3 years ago | (#35749146)

great. now we get the gold farmers in on factoring large primes. all encryption is about to go out the window.

Re:Other applications. (0)

Anonymous Coward | more than 3 years ago | (#35749774)

I'll bet you 10000$ I can factor any prime you present me, without a computer, in a matter of SECONDS!

Re:Other applications. (1)

ThatsMyNick (2004126) | more than 3 years ago | (#35750148)

Seconds? You must be slow!

Re:Other applications. (1)

Just Some Guy (3352) | more than 3 years ago | (#35750258)

I'll make it $20,000 if you can tell me whether the number is actually a prime.

Ow. That made my brain hurt. (-1, Redundant)

blair1q (305137) | more than 3 years ago | (#35748730)

And not in a good way.

If cicadas were important to birds, then birds would have evolved a boom/bust cycle of 7, 13, or 17 years.

Cicadas emerging in prime-number cycles in fact gives birds a feast every couple of years, except when the cicada cycles tend to align, then it's a super-feast for a year or two.

But more importantly, it keeps cicada species from being out at the same time competing for mating time with mates they can't actually reproduce with. (Food isn't relevant, since they spent their time in the ground as grubs eating so they could expend their energy looking in the skies for a mate, then finding a nice spot to latch onto and die). Except, again, in those years when they overlap, then they encounter those stressors, but now there are twice as many cicadas and the birds can't eat them all so both species end up doing okay anyway.

And the leap from cicada prime-number cycling (which, despite what I said, may just be a coincidence) to arranging tiles in a pseudo-random pattern to mimic random patterns in "nature"? That makes me feel like I'm gorged on cicada pasta and want to throw up.

First, since when are curtains "nature". Second, random things look random because they are random. Third, using prime numbers to mimic randomness is not randomness, unless you use a random-number generator to help you pick which of the prime numbers in your range to use. But then there was no reason to limit yourself to prime numbers. Because there was no reason to do such a thing in the first place.

Fifth, nature does cyclical rather handily; not everything need be random to look natural. In fact, the lack of repetition in something generally random but capable of repetition is a dead giveaway that it's not actually random.

Ow. Ow, ow, ow.

So totally the Pauli Excuseme Principle: "That's not wrong, it's not even right."

Re:Ow. That made my brain hurt. (2)

bigsexyjoe (581721) | more than 3 years ago | (#35748956)

It doesn't matter if cicadas are important to birds or any other predator. Predators are important to cicadas.

In any case, he's talking about making things look random enough for casual observation. He's not talking about some sort of advanced encryption algorithm. We know we can appeal to advance math and chaos theory for truly random. But this is just web design. If someone actually cracks the pattern, it isn't the end of the world.

Re:Ow. That made my brain hurt. (5, Insightful)

spun (1352) | more than 3 years ago | (#35748988)

Just because you do not understand something does not make it wrong. Birds haven't "evolved" a boom/bust cycle, that's not how that works. It's the standard predator/prey boom/bust cycle. Birds don't spend vast periods of time underground, you know. Curtains are natural, "natural" here taking the meaning of "organic" rather than "patterned.

Please, don't be one of those guys who tries to prove how smart they are by attempting to find fault with the article. It does not make you look as smart as you think. The fact that you hurt your brain trying to comprehend something the rest of us had no trouble understanding actually makes you look pretty dumb.

Re:Ow. That made my brain hurt. (0)

blair1q (305137) | more than 3 years ago | (#35750518)

Thing is, I do understand it, which is why I know it's wrong.

I'm not "one of those guys who tries to prove how smart they are by attempting to find fault with the article." I am smart. I found fault with the article. Several faults, upon review.

Not being smart when complaining about my complaining being not smart makes you a hypocrite, and doesn't reduce my smartitude one bit.

Re:Ow. That made my brain hurt. (2)

spun (1352) | more than 3 years ago | (#35750760)

No, you are simply wrong, as I quite clearly demonstrated, which is why you were modded down and I was modded up. So let me try to explain it in the very simple terms you need.

Again, birds did not evolve a boom/bust cycle. They can not pick it through evolution, it is not up to them, it is up to their predators and food sources. As the article clearly explains, a prime number cycle for cicadas ensures that only ONE predator boom/bust cycle will match up with theirs, and natural predator/prey cycles are not ever that long. Here, all you demonstrate is a complete lack of understanding of evolution and ecology.

You also have quite clearly either not read, or not understood the article. More importantly, you appear to not have even looked at the pictures. By overlapping patterns in prime cycles, a complex pattern is built up that does not appear repetitive to the eye. It was clearly demonstrated in the pictures, in case you are illiterate.

Curtains ARE nature, everything is. Hanging curtains create a natural, complex pattern of folds. A standard repeating background does not have those same complex patterns.

When you say "random things look random because they are random." you clearly demonstrate again that you have not read the article. Are curtains random? If you generated a 'random' curtain texture and tiled it, would it still appear random? No! It would not be seamless. But if you generated the tile using prime numbers, you could tile it and not see obvious seams.

As I explained, they are not using prime numbers to mimic randomness, they are using them to create tiles that appear seamless. You total fucking idiot.

When you claim "Fifth, nature does cyclical rather handily; not everything need be random to look natural." you AGAIN clearly demonstrate your total lack of comprehension about the article. They are not trying to create "random" you microencephalic retard, they trying to create background patterns that can be repeated across a page without appearing to be repeating tiles. You utter cretin.

Now fuck off and let the smart people talk. I'm done with you, you're dismissed from class.

Re:Ow. That made my brain hurt. (-1)

Anonymous Coward | more than 3 years ago | (#35749138)

Hey, moron, it's "That's not right, it's not even wrong!". It's obvious you don't understand what is meant by that, so you should refrain from attempting to sound smart from now on.

Re:Ow. That made my brain hurt. (5, Informative)

_0xd0ad (1974778) | more than 3 years ago | (#35749892)

The point isn't randomness, the point is unwanted harmonics in pseudo-random patterns. These unwanted harmonics cause regular repetitions in the pattern that make it seem predictable and non-random. Prime numbers are the basis by which a simple PRNG (pseudo-random number generator) generates seemingly-random data that doesn't repeat in any predictable manner. By overlapping two or more sequences with prime lengths, the length of the harmonic is maximized. That means the sequence goes longer before repeating itself. Sequences with non-prime lengths short-circuit the cycle.

For instance, overlapping three sequences of length 7, 11, and 13 forms the following pattern:
http://tinyurl.com/3wserj7 [tinyurl.com]

At a glance, the pattern looks fairly random and non-repeating; however if you look more closely you see that the vertical bands of color are repeating very regularly within the pattern. But, since their periodicity is prime, the pattern as a whole doesn't appear to repeat itself. Using alpha and larger 2-dimensional tiles you can create even more complex and random-seeming patterns.

The life cycle of cicadas is similar in that the overlapping cycles tend to cause a seemingly-random pattern of years with lots of cicadas and few cicadas, such that the life cycle of their predators is less likely to hit a bunch of good cicada years in a row and seriously harm the population of them.

Re:Ow. That made my brain hurt. (0)

blair1q (305137) | more than 3 years ago | (#35750712)

The last time I discovered an "unwanted harmonic in pseudo-random patterns" I found that if you combine the return values from rand(3) in a certain way there's a consistent pattern to the final bit. But only in a certain way. You can't detect that periodicity just by doing a discrete fourier transform on its outputs.

Yes, a PRNG, particularly an LCRNG, depends inexorably on the lack of common factors in its coefficients. But that's an aside to what this article is implying (though if he'd gone any further he might have derived an LCRNG from his degenerate use of prime numbers; one with a strikingly low periodicity, but then he says the words "degenerate example" and I'm okay with it as an example, and reminded of Martin Gardner and Jearl Walker teaching us all how such things work back when SciAm was worth the paper it was printed on).

The fact is, using rand(3) produces a lot less periodicity than using the same 3 numbers in various combinations. And, as I said, the latter eliminates accidental periodic subpatterns that would make the output look more natural. Once you're getting to the point where your tiling algorithm is more complex than just "move right N places and place another copy of the tile" you might as well use the standard library you're given instead of reinventing the wheel (or the Monotonic Random Walk in this case).

Re:Ow. That made my brain hurt. (0)

Anonymous Coward | more than 3 years ago | (#35750450)

Your type of comment is the reason /. is off my bookmarks. Here some guy come up with something positive, inspirational and beautiful, but no, it has to be dead, lifeless, boring and utterly correct. BS comments and BS perspectives for keeping alive your pet dogmas and paradigms.

Re:Ow. That made my brain hurt. (0)

blair1q (305137) | more than 3 years ago | (#35750816)

If this site isn't bookmarked, how did you get here?

No, he doesn't have to be "utterly correct". But being somewhere inside the ballpark on his basic premises would be a decent thing.

His attempt to make this look "positive, inspirational and beautiful" by falsely linking the reproductive cycles of a living thing to his webpage-background generator clanked. That's too bad. But, as it turns out, he clanked all over the page, so maybe it was only natural.

We've all seen capable examples of the nature-as-inspiration-for-mathematical-discovery trope (Hofstadter, Myers, Burke, Dewdney, etc. made a great genre out of them). Generally they're logical in themselves, and that's a beautiful thing. But when they're illogical it's not a beautiful thing, it's a self-conscious attempt to look like the people who can do it properly, or a failure to realize that the form is not the substance.

Have fun not reading /. I hear it's almost as enlightening as reading /.

Re:Ow. That made my brain hurt. (3, Insightful)

JordanL (886154) | more than 3 years ago | (#35750702)

You somehow simultaneously displayed a lack of understanding for the mechanisms of evolution (mutation and natural selection), and obliviousness to the point of the mathematics being discussed: using prime numbers to reduce periodicty of a given set of cycles.

Also, your third and fourth paragraphs display utter ignorance of biology.

Why are you even here? This article was very well articulated, and more important, useful, unlike your reply.

TL;DR (1, Insightful)

Narksos (1111317) | more than 3 years ago | (#35748800)

Designer discovers basic properties of the prime numbers (and confuses 1 for a prime).

Re:TL;DR (4, Insightful)

Anonymous Coward | more than 3 years ago | (#35748822)

How about: Designer discovers new way to use special properties of primes to create more realistic tiled background images.

C'mon, the results are actually pretty cool.

Re:TL;DR (3, Funny)

gstoddart (321705) | more than 3 years ago | (#35748852)

Designer discovers basic properties of the prime numbers (and confuses 1 for a prime).

You missed the important thing ... designer creates huge frickin' lego army using a small number of images and some pretty smart use of CSS.

An army, but make out of lego. Put lasers on them and see who takes over the world. :-P

Re:TL;DR (0)

Anonymous Coward | more than 3 years ago | (#35749652)

Give it a few more years, then some MD will come around and patent it.

Re:TL;DR (4, Interesting)

sootman (158191) | more than 3 years ago | (#35749696)

How about: Designer comes up with interesting, relevant use of math that all the Math geeks who have been running the WWW for 20 years didn't think of on their own.

Subtitle: Bitter math nazis harp on his confusion about 1 being a prime.

I'd like to cum in a black girl's cunt. (-1)

Anonymous Coward | more than 3 years ago | (#35748816)

I'd like to cum in a black girl's cunt, and have her bounce up and down on me when I hold her black tits.

Kind of neat (1)

bigsexyjoe (581721) | more than 3 years ago | (#35748978)

It's kind of neat that you can involve a little math in something like web design. Granted this isn't calculus, but it's still a fun little way to make neat patterns.

Really learned a LOT from that one (3, Interesting)

erroneus (253617) | more than 3 years ago | (#35749058)

Not only did I learn interesting information about the insects I hate the most (and believe me, if I could, I would destroy every last one of the annoying bugs!) but I also learned that you can have multiple images for backgrounds in CSS and have them lay atop one another. (None of the books or software ever seemed to suggest that it was even possible!)

While the idea is pretty ingenious, if I had known you could specify more than one image for backgrounds, I would have figured this one out on my own -- I have been overlaying images and background images inside of DIVs for a while to get some really nice effects. But now, to be able to lay one atop the another in the same block? AWESOME.

And yes, at the article says, inferior browsers cannot handle this -- I tried it on IE8 to see what would happen and... yeah... it hung.

Re:Really learned a LOT from that one (1)

DeionXxX (261398) | more than 3 years ago | (#35749186)

CSS3. Lots of cool stuff in there. Background gradients, rounded corners, animation, etc.

Re:Really learned a LOT from that one (5, Insightful)

Hooya (518216) | more than 3 years ago | (#35749226)

> if I had known you could specify more than one image for backgrounds, I would have figured this one out on my own

You may want to read this: http://en.wikipedia.org/wiki/Egg_of_Columbus [wikipedia.org]

I have been doing layered images for over 4-5 years (multiple divs with backgrounds layered over one another) to come up with cool effects. But I would have never come up with this. I had been thinking about tiles and the non-random-ness for quite a while too. This didn't occur to me. Now that someone put this together - sure it's simple. But that's the genius of it.

My hats are off - simple, efficient, brilliant.

Re:Really learned a LOT from that one (1)

camperdave (969942) | more than 3 years ago | (#35749418)

Um... If Columbus challenged his critics to stand an egg on it's tip, then why is the statue showing the egg standing on it's end?

Re:Really learned a LOT from that one (1)

mrchaotica (681592) | more than 3 years ago | (#35750508)

Because the statue shows the egg in its post-Columbus state.

Re:Really learned a LOT from that one (1)

SpinningCone (1278698) | more than 3 years ago | (#35749798)

I concur, this was a really cool technique, i had seen a few articles with clever use of transparency for certain effects. this one is pretty sweet though i suspect it takes quite a bit of work to make sure your layers blend in a nice way

you also still have to avoid uinque features. for example even if you were varying width and height to make say a stone or gravel pattern, if you had one particularly unique stone in the upper layers it would stick out still. same with knots in wood.

it might have some uses in textures for games.

Re:Really learned a LOT from that one (1)

Jake Griffin (1153451) | more than 3 years ago | (#35750772)

you also still have to avoid uinque features. for example even if you were varying width and height to make say a stone or gravel pattern, if you had one particularly unique stone in the upper layers it would stick out still. same with knots in wood.

If you had RTFA, you would have seen that he mentioned that toward the end. Of course, this is slashdot...

Re:Really learned a LOT from that one (2)

blincoln (592401) | more than 3 years ago | (#35749916)

It's not *that* revolutionary. A few months ago, I used the same general principle to make a more interesting rotating "please wait" symbol: I made multiple ring animations with transparent backgrounds, with each ring completing one revolution in a different number of frames. I used odd numbers, but not primes specifically. Anyway, the result was conceptually the same - it takes quite awhile before the rings ever line up in exactly the way they started, but only a handful of animation frames are used, because it's separate files overlaid on each other, and each one alone is a short animation. I was thinking of the "counter-rotating concentric rings" look that has been used everywhere from Tron to Dead Space. The designers on those may have even done exactly the same thing I did.

I'm also curious to see just how useful this specific technique is for things other than website backgrounds. For example, you couldn't use it (at least without modification) for most 3D object textures, because it only introduces variation along one axis.

Re:Really learned a LOT from that one (1)

mrxak (727974) | more than 3 years ago | (#35750214)

Yeah, I've used prime cycles to generate random-like occurrences before. Struck me as obvious, really, though my application of the concept isn't graphical. Anyway, it was a good read. I would love to see something like this put into video game textures for stuff like wood and stone.

Re:Really learned a LOT from that one (1)

mrchaotica (681592) | more than 3 years ago | (#35750580)

For example, you couldn't use it (at least without modification) for most 3D object textures, because it only introduces variation along one axis.

That's true for his first two examples (only because he picked inherently non-tiling-in-the-y-direction things), but the third (the Lego army) varied in two dimensions.

Re:Really learned a LOT from that one (1)

ObsessiveMathsFreak (773371) | more than 3 years ago | (#35750300)

True indeed. In fact, I would go farther. I think this has the potential to become a classic textbook example of number theory.

This is an impressive and visually interesting application of basic number theory. I would not be surprised if we began seeing the presentations modelled on the Legion of Lego [sitepoint.com] showing up in the slides of number theory lectures in the near future.

Re:Really learned a LOT from that one (1)

Ksevio (865461) | more than 3 years ago | (#35749250)

Up until a few months ago support was even worse. We've only recently gotten support for many useful CSS3 elements.

Why did you do this? You hate America?? (2)

140Mandak262Jamuna (970587) | more than 3 years ago | (#35749216)

Now, next time Iran fakes out a missile launch test and claims it has tested some 53 rockets and shows pictures, it is going to be impossible to detect the cut/paste jet plumes.

Re:Why did you do this? You hate America?? (0)

Anonymous Coward | more than 3 years ago | (#35750826)

Been done before. Crowds of Anonymous?
He's really just one guy in a mask with Photoshop and some math.

I DEMAND SLASHDOT ANSWER MY QUESTION (0)

hellop2 (1271166) | more than 3 years ago | (#35749604)

Question: Do cicadas come every 17 years, or do they come every year?

Having lived in the Deep South for 5 years I seem to remember cicadas coming every year. Wikipedia says there are "broods" and there's 2500 different species. So, was I seeing a different species every year, or did I just see a different brood every year? I think I saw 2 different species.

Re:I DEMAND SLASHDOT ANSWER MY QUESTION (1)

hellop2 (1271166) | more than 3 years ago | (#35749948)

Because I can't figure out the answer to this question! And whenever someone asserts that they only come every 17 years, it drives me crazy!

Re:I DEMAND SLASHDOT ANSWER MY QUESTION (0)

Anonymous Coward | more than 3 years ago | (#35750096)

They actually emerge every year, its just certain cycles have predominantly more emergence than others.I find them every year crawling out to split their casings and fly away.

Re:I DEMAND SLASHDOT ANSWER MY QUESTION (1)

mrxak (727974) | more than 3 years ago | (#35750234)

Remember also that there's multiple species on differing cycles.

Is it a bad sign... (1)

Hakubi_Washu (594267) | more than 3 years ago | (#35749630)

...that my first thought was "Ah, someone has finally understood why Gödel numbering [wikipedia.org] is clever..."?

Re:Is it a bad sign... (1)

NoSleepDemon (1521253) | more than 3 years ago | (#35750134)

My immediate reaction was that this kind of stuff is taught in introductory CS lectures as Perlin Noise, I suppose web developers with their javascript don't need to learn real programming or the application of complex algorithms :)

I hate numbers (0)

Anonymous Coward | more than 3 years ago | (#35749940)

... there's too many of them.

Congratulations... (0)

NoSleepDemon (1521253) | more than 3 years ago | (#35750122)

...Are in order for the web developer community; they've discovered Perlin Noise! [virgin.net] Aww bless! Meanwhile, game developers everywhere have been using this technique to generate anything from planetary landscapes to entire galaxies for a while now. Baby steps guys.

Re:Congratulations... (5, Informative)

_0xd0ad (1974778) | more than 3 years ago | (#35750282)

This is very much not like Perlin noise, because Perlin noise uses octaves (doubles in frequency). Octaves are harmonic with each other by definition. This uses primes, specifically to cause the harmonics to occur as far apart as possible. Using octaves in this way would cause very repetitive-seeming patterns because the maximum size of your pattern would be defined as the size of your largest sequence, and all of the shorter sequences would tile into it in a neat checkerboard.

Perlin noise requires infinite sequences of pseudo-random numbers and would be extremely ill-suited to using short repeating sequences. This is specifically designed to minimize the length of the sequences you use without causing obvious repetitions in the pattern by using sequences of prime length (since your "sequence" is a PNG, if it's too large it takes a long time to load).

Re:Congratulations... (0)

Anonymous Coward | more than 3 years ago | (#35750656)

Exactly. If anyone has mod points, mod parent up!

this is so obvious (0)

Anonymous Coward | more than 3 years ago | (#35750298)

I've been using primes as max-mount-count for my ext3 filesystems to avoid checking them all at the same time for years

Whatever happened to fractals? (2)

DrVomact (726065) | more than 3 years ago | (#35750362)

Cool, but aren't we all supposed to be using fractals to generate realistic-looking virtual worlds and such by now? I mean, that's what I thought when I read that Scientific American article back in the 80s, and wrote a C program that ran for two weeks on my Compaq to create a picture of a Mandelbrot set. What was really funny was that the Compaq screen was grey scale...

Why prime? Any irrational numbers should be fine. (0)

gblackwo (1087063) | more than 3 years ago | (#35750752)

It makes no more sense to me to use prime numbers as opposed to pi or anything else that will give you irrational numbers.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?