Question about BGL_SCALE command

Firestriker

Resource contributor
#1
For FS2002, I am trying to imbed effects in my _0.ASM using the BGL_EFFECT command. It appears that either a BGL_SCALE (effect does not have to be on the ground but specified at MSL) or BGL_SCALE_AGL (effect must be on ground) command must preceed the effect command. Can someone break it down in plain english and how do you convert Lat. Lon. to hex or can you use standard DD:MM:SS or decimal degrees instead of hex.

Lou
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#2
Hi Lou,

It is described rather nice in the Fs2000 scenery SDK.

The longitude is a 48 bit angle. So you take the two values as stored in the ASM code (for example E38E38E3h 8E39h). Combined these give a 48 bit hex value. If you divide that by 2^48 and multiply it by 360 you will get an angle. In my example the result is 320 (my longitude was -40).

For the latitude it is a certain amount of meters. The 32 bit value gives you the main value and the remaining 16 bit is the fractional part (for example 43D426h 38E4h). If you take the 32 bit part and convert it to decimal you get a number of meters from the equator. To that you need to add the 16 part, divided by 2^16 (to get a fraction). This total amount of meters is then divided by the radius of the earth (6367310 meters) to give you an angle in radians. Divide this by pi and mulitply by 180 to get it in degrees (40 in my example).

Hope this helps :).
 
Top