Hi, I looked at the rain code and it seems a more elegant solution than what I've done so far. I just passed the needed info as elements of a struct which I filled with the same get-methods in renderer.cxx.
However, as it appears you can only read and set the information in the property tree. But what I would need is a function I could call that calculates some values. So even when I would use the set-methods to put my data in the property tree, this wouldn't be adequate. The reason for this is that I'm considering the average density along the light-path. This is necessary because it can differ vastly depending on the planes position and results without this aren't realistic. For example, take two positions, in which the distance of the light-path is equal but the altitude of the observer is different. The sun will be much more yellowish for the observer at a lower altitude because the average density is higher and there's more scattering taking place. Also the light-path can go through areas of higher and lower density if the observer is at a higher altitude and the sun is setting. In this case the light first travels through low density arriving from the sun, then higher density at earth-level and then again traverses low density air at the observer. So only taking the observers density and the density at the top of the atmosphere in account is not going to act as a accurate substitute. To figure out the average altitude I determine the density at the observers position, the density at about 8-16 km (depending on the lat due to different thickness of the stratosphere at the poles and the equator) and the density at the half of the distance the light travels through the stratosphere. This gives a rough idea of the average density that is good enough for our purposes. So ideally I would have to pass an altitude to the function and it should return the density at that height. But then the environment code is in Flightgear. I could, however, put the code somewhere else in Simgear, but what's the sense to scatter basically the same type of functions around different parts of fg/sg? I don't know. Any Ideas? Mark Melchior FRANZ wrote: > * Mark -- Sunday 09 July 2006 19:03: > > Looks beautiful, indeed. (Only the outer halo border is a bit too > obvious. :-) > > > > >> Right now i'm doing alot of calculations in the repaint-method that >> deals with enviromental values, such as humidity, visibility and density. >> This is necessary, since this kind of information currently is dealt >> with in FlightGear's Enviroment branch. Since the sun is calculated in >> Simgear, I can't access the information there. >> > > Look how the rain code does it. It uses default parameters, but has > a config function in simgear/environment/visual_enviro.cxx that is > called with a property node as argument. This is then called from > fgfs and tells simgear where to get the 'real' parameters from. > > SGEnviro::config(const SGPropertyNode* n) > > m. > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Flightgear-devel mailing list > Flightgear-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/flightgear-devel > ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel