I have been working on refining the thermal modelisation.

This is a first attempt, with still a lot of limitations,
but it gives the thermal a much better shape and behavior yet.

These thermals lean in the the wind, the more wind, the more they lean.

They are surrounded by a global, gentle sink, which is unrealistic for now, 
but makes the flight a bit more challenging. I have set this to -1 fps, I 
will change this in a next version.

They are slightly conical, with a 0.8 factor at the base.

They are surrounded by a slight sink area, that we often feel when entering a 
thermal in real. When you come from outside, from the 'global sink' area, you 
gradually feel some sink, until sink reaches 0.25 times the max updraft that 
you will find at this altitude. probably unrealistic too, but its an 
approximation, again. Then updraft goes stronger, until you reach the thermal 
core.

The power of the maximum updraft you find depends on your height too. From 
ground level to 1/10 of the thermal height, you don't feel updraft at all, 
then, the higher you climb in it, the stronger the updraft. When reaching 
into the cloud, updraft slowly tends to zero. For simplification I made this 
happen at 1.1 times the ceiling alt. This could be refined, as in real, the 
updraft continues in the cloud, almost until reaching the cloud top, at an 
altitude which depends on the strength of the thermal. But we aren't supposed 
to be here with a glider, are we ?

A picture talks better maybe :
http://img7.imageshack.us/img7/4977/newthermal.jpg

If you set the strength to a negative number in the demo xml file, then you 
get a big sink. This one behaves differently. When coming from outside, you 
are feeling 'global sink', then gradually sink raises to its maximum until 
you reach the sink core. Again, if you come down close to the ground, or high 
close to the ceiling, the sink effect goes lower until it reaches zero.

Be careful when setting the demo file, so that either 2 thermals or a thermal 
and a sink don't overlap. This leads to strange results, due to the fact that 
for now, FG only takes the effect from the closest. When FG suddently takes 
the other one in account, you could get a abrupt break in lift/sink. I 
included a demo file whith no overlappings.


In the code, you will find that there is a life cycle ready to be used. I 
disabled it for now, because , so far I didn't find a way to make the thermal 
cap appearance change with time. So you could see a nice cumulus, go under it 
and find nothing at all.
Its easy to toggle it on again, by just commenting/uncommenting 2 lines.
If someone can find a way to make the cloud cap grow / shrink during the life 
cycle, it would be cool ! The best would be to call simgear to draw a nice 3d 
cloud, too. I didn't find how to do that, but I'm sure its possible.

Basically, the life cycle makes this :
first the thermal is not born.
then it begins to appear, and grows both in intensity and altitude, until it 
reaches the ceiling after 5 minutes. Then, it stays active for 15 minutes. At 
this moment, it begins to die, from bottom to top, until nothing is left. It 
waits 5 more minutes, then starts again the cycle.
Some random offset is added so that all thermals live their lives at different 
moments.

All the time numbers are hard coded for now, as well as the proportion between 
lift/sink radius, the global sink, the height of the 'cloud', the conical 
factor ,so that the new thermal is compatible with all old thermal demo xml 
files.

You can get it all here : http://www.bentha.net/fgfs/thermal/new-thermals.zip.

My code is probably very ugly and not efficient, I am not a coder, I really 
don't know how it should be made to be better, but at least this works ( for 
me ).
If someone is willing to make it cleaner/faster , it would be neat. All the 
global idea and math is here ready for use :)

What I am working on now, is a totally different approach.
So far in FG, we have thermals that one has to 'plot' in a xml file, each 
being a AI object.

I am working on a big 'thermal system' AI object, which is the modelisation of 
a big area of the atmosphere around its center. everything can be refined to 
a higher level or complexity and realism in this.
You would just define a x,y size of the big thing, and put it somewhere. Its 
not really consuming in cpu, as this is all parametrical, and only needs to 
compute the closest ones to the glider. Its probably more memory eating, 
though.
The thermal caps will be submodels of the 'thermal system', and they would 
move and animate to display the 'state' of the whole thing.
Again, I don't find how to make simgear pop a 3d cloud here, but I'm sure 
someone skilled could do this.
One of the nicest feature is that these thermals can move with the wind, climb 
slopes, die on edges, never appear on sea, lakes....appear more often on 
cities, and most of all, depend on the real weather. You can give it 
parameters, too, so that it produces more or less thermals, a lot of small, 
distant ones, or big fat weak ones, or anything. The life cycle can depend of 
temperature, time in the evening... The formulas to make something certainly 
not physically correct, but realistic enough to have a nice soaring feeling, 
are not that complex.
I'm almost sure I can introduce real hour time in the calculations, so that 
everyone feels the same scenario in multiplayer, or at least something close 
enough to do nice flights together.

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to