• "Mwoah" - Kimi Räikkönen

# Help on sun settings in RBR

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

1. ### eno72

Messages:
120
Ratings:
+10
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. ### jharro

Ratings:
+0
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
etc.

you can use a sun position calculator to obtain the angles

if:
azimuth = 176.05
altitude = 48.42
then:

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.

File size:
40.4 KB
Views:
95
3. ### eno72

Messages:
120
Ratings:
+10
thanks a lot, very kind of you. Really exhaustive, should be mentioned in the help file of btb!

4. ### jharro

Ratings:
+0
not really, no, you can google math.