Allegro.cc
Projects
 Action 252 Adventure 22 Arcade 216 Board Games 30 Demos 24 Emulators 10 Other 68 Puzzle 139 Role Playing 40 Sports 25 Strategy 58 Utilities 46
Resource Directory
 Code Gallery 3 Compilers 12 Help & Documents 13 Libraries 63 Media 2 Tools 8
IOTD: Fire-algorithm in 3D using PovRay
Fire-algorithm in 3D using PovRay, by kentl

As part of a university course i had to create a picture in PovRay, as i am not the artistic type of human being i thought that i would try to illustrate an algorithm instead.

First i thought about recursive patterns, but finally decided to take the old demo-algorithm Fire and make it in 3D. This is how it works roughly:
1. for i = 1 to 30
2. At random put out 200 number of particles in a box of size 20x20 located in the middle of the space, each particle with varying intensity.
3. For each "particle slot" in space: Let next intensity be: [sum of surrounding 6 `particle slots' intensity and current intensity]/4 if a particle gets a lower intensity than 1 (as it's of type float) let it be 0.0
4. next i
5. Draw all "particle slots" on screen, each particle represented as a sphere with color and size depending on it's intensity.
The result is, as you can see quite similar to a sphere itself. I am not 100% satisfied with it, but as the growth is in all directions with equally degrading intensity i think it's hard to get away from the basic shape. The "small explosions" you see on the surface is due to the randomness of step [2].
looks great si-fi face wizzard of oz - piccolo
I have no idea how this is supposed to be fire, but it looks cool. - 23yrold3yrold
Thanks, it would have looked a bit better if i had chosen different colors (more firery ). It looks more like some kind of explosion, or wired thingy. - kentl
I think thas pretty usefull with some tweaking i'm pretty sure I can use it to render explosions, which I have yet to master drawing. good job man. - flares
This section is only available to registered Allegro.cc members.