Skip to main content
gamedev.net
🔒 Locked

Flame function.

Started by Vlion Nov 26, 2001 at 2:47 PM 9 replies 1k views
Original Post
Vlion
Vlion
Hey. Has anyone worked out the equations and functions goverening flames ? For instance: Get a variable lighter from a store. Move the little button to the lowest value. Light it, and adjust it upward. Observe: The size of the visible flame increases and descreses by a set value, according to a input. So, according to the fuel amount, a set size of opening, the flame will change size. I was studying my lighter flame today, and I realized that it cannot be a standard polynomial function. Put into 2 dimensions, you have 2 y values resulting from a single X. So thats impossible to represent via computer graphics. I think it would be a parametric function, rotated along the y axis. Am I correct, incorrect ? I came, I saw, I got programmers block. ~V''''lion
~V'lionBugle4d
v71
v71
well what you say is well know in physics dealing with a very large of interacting particles, that''s why is used a statistical velocity or stocastic methods to compute a volumetric energy, so i think that one day we''ll have a realistic gaseous or firing routine , but is not likely to come very soon, try to simulate instead....just my 2 cents

Vlion
Vlion
Sorry.
What I meant is that.....

Y
| _
| ( )
| ( )
| | |
| ( )
| ( )
|
---------------------------X

Thats how my lighter shape looks in 2D.

But what Im seeing is that when the gas input is smaller, the width is slighly shrunk, and the height of the flame is decreased.

I know in reality a gazillion factors affect it.
Density, element mix in air, wind, tempature, direction flame points...it goes on and on.

However.

I
m just thinking a good equation would simulate it quite well.
Because Ive hardly ever seen computer flames look partially real, Id like to have a good general equation that would work.





I came, I saw, I got programmers block.
~V''lion

Edited by - Vlion on November 26, 2001 12:45:50 AM
~V'lionBugle4d
KwamiMatrix
KwamiMatrix
Differential equations govern the physics of flames. Really complicated I suppose.

Edem Attiogbe
Edem Attiogbe
grhodes_at_work
grhodes_at_work
quote:
Original post by KwamiMatrix
Differential equations govern the physics of flames. Really complicated I suppose.

Edem Attiogbe


Well, true, if you want to get into all the nitty gritty detail (which game developers often don't). The Navier-Stokes equations govern the flow, but its a chemically reacting flow so you need simulated chemistry as well, not just simple equations of state such as the ideal gas law, to close the equation set. Flame simulation is some of the hardest CFD of all. (I studied under a professor at North Carolina State University who has done high-end flame physics simulation for a few years now.)

BUT, there are always simpler ways for games. Simple models such as those suggested by Vlion and v71 can produce results that are just fine.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Edited by - grhodes_at_work on November 30, 2001 6:26:12 PM
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Vlion
Vlion
Yeah.
I`m just asking if anyone has come up with a good approximation of a flame shape.



I came, I saw, I got programmers block.
~V''''lion
~V'lionBugle4d
python_regious
python_regious
quote:
Original post by grhodes_at_work
Well, true, if you want to get into all the nitty gritty detail


You''d have to bear electrostatic forces in mind too then

If at first you don't succeed, redefine success.
Thrump
Thrump
I wrote this flame function a while ago. Might be what you're looking for.

    

char *pcFlames[4]={
"C++ is better!",
"VB is better!",
"You're so stupid!",
"Shutup!"
}

char *pcNames[4]={
"Johnny",
"Sally",
"Bob",
"Mike"
}

main(void){
while(TRUE){
printf("%s> %s\n", pcNames[rand()%4], pcFlames[rand()%4]);
}
}



Edited by - Thrump on December 3, 2001 7:20:43 PM
Vlion
Vlion
Good one Thrump.
Thats a interesting demo, but not really what I`m looknng for.
I sense a reasearch topic in the offing... :-D
~V''lion

I came, I saw, I got programmers block.
~V''''lion
~V'lionBugle4d

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.