> There's the problem Thorsten. I didn't have the info or the knowledge to
> do the second bit.
Neither you nor Emilian honestly could have come up with something like this?
=================
var setBasicWeatherScattering = func {
# establish the minimum cloud cover
var max_cover = 5;
for (var i = 0; i < 5; i = i+1)
{
var current_cover =
getprop("/environment/clouds/layer["~i~"]/coverage-type");
if (current_cover < max_cover) {max_cover = current_cover;}
}
# convert to scattering parameter, simple linear mapping
var scattering = 0.5 + 0.1 * max_cover; # 5: clear sky <-> scattering =1 0:
overcast sky <-> scattering = 0.5
# check of we should set it at all
if (getprop("/local-weather/interpolation-loop-flag") == 0) # advanced weather
is not setting parameters
{setprop("/rendering/scene/scattering", scattering);}
# check every 5 seconds
settimer(setBasicWeatherScattering, 5.0);
}
================
(I just typed this as a demo without testing - I don't know offhand what
getprop("/local-weather/interpolation-loop-flag") returns when the property
isn't initialized because the Local Weather module isn't loaded, I believe the
property is simply created and initialized as zero if it didn't exist before,
but if not it can be created before Nasal starts in
/Environment/local-weather-defaults.xml.)
I mean, you have written code that's way more sophisticated than that...
* Thorsten
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel