• This Website Is Not For Sale
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help on sun settings in RBR

Discussion in 'Bob's Track Builder' started by eno72, Apr 21, 2009.

  1. It seems that moving the sun in btb does not effect the sun position in RBR. Actually, the settings.ini contains three lines with "sun direction" and 3 numbers per line. These numbers are always the same when exporting, and I cannot figure out how they are related to the coordinates of the sun, maybe I missed a thread about it...
  2. 2 of those lines have ";" at start which means they are commented, so they are ignored.

    the 3 values are the X, Z and Y of the the sun direction, not position, in example :
    zenith(above): sunDirection = 0, -1, 0
    right(east) 45degree: sunDirection = -0.707107, -0.707107,
    left(west) 45degree: sunDirection = 0.707107, -0.707107, 0.0
    back(south) 45degree: sunDirection = 0, -0.707107, 0.707107

    you can use a sun position calculator to obtain the angles

    azimuth = 176.05
    altitude = 48.42

    x = sin(176.05) * sin(48.42) = 0.0688859 * 0.7480298 = 0.0515287
    z = cos(176.05) * sin(48.42) = -0.99762455 * 0.7480298 = -0.74625289
    y = cos(48.42) = 0.66367

    sunDirection = 0.0515287, -0.74625289, 0.66367

    if you don't want to bother with the math you can always draw a line with length 1 unit in max or any other 3d editor, rotate the line by x for altitude and z for azimuth. if the line's start is at origin(0,0,0) then the coordinates for the other end are exactly the values you need for sun direction.

    Attached Files:

  3. thanks a lot, very kind of you. Really exhaustive, should be mentioned in the help file of btb!
  4. not really, no, you can google math.