🔒 Locked
Rendering PI
Advertisement
Original Post
I used the BBP algorithm for pi digit extraction, which is handy because it returns hex numbers, which translate into pixel values fairly easily. I started the program around 1am, and this is where I got at around 10am. The progress indicator is hosed, I forgot to blank it out before drawing the next reminder. I have some ideas to speed it up a little bit, as well as some ideas to slow it down, but make it more colorful. I thought about 'chopping the picture to make it look like it just barely drew out a picture of pie, and then replacing it with the original in an hour, but no. I was going for 1024x768, but by the point where it's at it's only calculating less than 1 digit per second.
hehe, it was a challenge between me and JM in #gamedev last night. I think I went way to far, though, because we were only supposed to do to a million digits of pi.
I was suprised at how easy the BBP algorithm was to understand. In its basic form, it's useless for digit extraction, but a little algebra here and there gets you the digit extraction.
edit: I was wrong.
just now I thought of a way to modify it for constant-time digit calculation, instead of linear time.
I was suprised at how easy the BBP algorithm was to understand. In its basic form, it's useless for digit extraction, but a little algebra here and there gets you the digit extraction.
edit: I was wrong.
well, my avatar is now a 50x50 pixel image that uses 3 hex digits of pi per pixel, so a total of 7500 digits of pi in just that image. The previous image only uses one hex digit per pixel, which is why it is only blue.
Isn't this idea from Carl Sagan's book "Contact"...
Quote:I have no clue
Original post by ffx
Isn't this idea from Carl Sagan's book "Contact"...
Quote:Not for those of us with a cache.. *reloads* ah.. looks like some of my first mode 12 basic programs. :)
Original post by capn_midnight
well, my avatar is now a 50x50 pixel image that uses 3 hex digits of pi per pixel, so a total of 7500 digits of pi in just that image. The previous image only uses one hex digit per pixel, which is why it is only blue.
Quote:Now that you said it, yeah.
Original post by Ravuya
There's a face in the middle.
Quote:
Original post by ffx
Isn't this idea from Carl Sagan's book "Contact"...
Not really. In Contact, they just analyzed pi's digits in various bases for patterns. They weren't specifically rendering images, although they ended up with one. In base 11, I think, the digits drew a perfect circle.
CM
Quote:
Original post by Conner McCloud Quote:
Original post by ffx
Isn't this idea from Carl Sagan's book "Contact"...
Not really. In Contact, they just analyzed pi's digits in various bases for patterns. They weren't specifically rendering images, although they ended up with one. In base 11, I think, the digits drew a perfect circle.
CM
Yeah, that's it. Sort of perfection inside a perfect number.
Quote:
Original post by Vampyre_Dark OMG!
Capn_midnight is alien from mars and is trying to take over the world
Ruuuuuuuuuuuuuun!
You should do a nice high resolution one in color, then print it out and tell people you don't like that it's a magic eye image.
CM
CM
The problem is, the image is completely determined by how many digits per pixel you use, and how many pixels wide you set the image.
On a related note, I'm thinking of doing this project in our G5 lab. We have 8 Mac G5's, each with dual 2GHz core, dual processor setups.
On a related note, I'm thinking of doing this project in our G5 lab. We have 8 Mac G5's, each with dual 2GHz core, dual processor setups.
Quote:
Original post by capn_midnight
The problem is, the image is completely determined by how many digits per pixel you use, and how many pixels wide you set the image.
On a related note, I'm thinking of doing this project in our G5 lab. We have 8 Mac G5's, each with dual 2GHz core, dual processor setups.
The beauty of my suggestion is that it doesn't matter. You're just trying to trick somebody into staring at a picture of noise for a few hours. Any random width and color depth will suffice.
CM
You can download a couple of gigs of pi from a few sites. (google around and you'll find it. Its like (firstdigitsofpi).com (replace the stuff in the brackets with the actual digits).
From that, it should be pretty simple just to parse it and load it onto one massive image. (two prime numbered sizes to make it nice).
You then send it out into space, to see if et has learned pi yet. (or you use it for obnoxious visitors).
From,
Nice coder
From that, it should be pretty simple just to parse it and load it onto one massive image. (two prime numbered sizes to make it nice).
You then send it out into space, to see if et has learned pi yet. (or you use it for obnoxious visitors).
From,
Nice coder
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement
OMG!
