- Sun Jun 26, 2005 9:30 pm
#39482
Ok, I really was sick of it. The sun seemed to be completely out of control, and i had no idea how the sun was calculated, and what worked, and what not.
These test were run with Cinemaxwell, but the principle and the texture used should work in any 3D app. All astronomical data are from http://www.calsky.com
So first I build a sun dial to read out the sun position in terms of rectacension (hour angle) and declination (~height). This was just a bitmap with circles and lines calculated for the different angles. You can download it here (1 MB):
http://klausbusse.de/Temp/Maxwell/TangensMap.zip
The fat circles are 5° lines, with the 15°, 30° marked in orange and the 45° marked in blue. Starting with 60° (which is again marked orange) every degree is marked with a thin circle. Combined with a proper cone to cast the shadow you can get the sun angles from the rendered image with enough precision to know what's going on. The cone has to have the same length as the distance of the blue circle and the center. Get a complete Cinema file here - 20 k, remember that you have to reassign the texture to the material!:
http://klausbusse.de/Temp/Maxwell/SunPosition.zip
Then I started rendering. To strip it down to the basics I started with a Latitude of 0 and GMT of 0. First I found out that the Cinema sun which I planned to use as a reference was hard to use, because it changed the hour angle based on Longitude and the current time settings of the local machine!
So, to get 12:00 for the Null meridian, I had to add 2 hours (which is my current time zone) and pu in 14:00 to make it work
Details see here: http://klausbusse.de/Temp/Maxwell/CinemaSunBug.jpg
Ok, then I looked up in Calsky the transit data for July 15th for that location, and came up with 71.5° at 12:06 for the transit. So I put in 12.1 for the time in Maxwell and rendered. Well, that was a loooong shadow I got here... about 62°, so the sun was at... (90-62=) 28°. That's was completely in line with my prvious observations that the shadows are much too long... Now I did the same with a longitude of -40 - and that was quite revealing:

That's interesting - the shadow is shorter (near 20°, so the sun was up at 70°+), and the image is much brighter - hey, that's it... actually it seems that someone flipped the wrong vector: The declination of the sun is calculated for the wrong hemisphere! In reality it's winter in the south hemisphere, so the shadow should be longer there, and the declinations match exactly what they should be in the other hemisphere!
Next I tried to get the influence of the month and found out that the month popup just do not work at all!
Then I checked for GMT compensation and latitude, and this seems to work ok as first tests show.
Sun rise and sun set are not calculated very well, the day seems a bit shorter - however, I think I'll test that later more thoroughly.
So, now everybody is invited to use this texture/scene to contribute more observations, and NL should make this work right after or while they fix the Cinemaxwell Mac beta...
It's not hard to fix, as the sun simulation is actually pretty good - there are two things to change:
The longitude coordinate must change sign to get to the correct hemisphere. As a side effect this will change the north/south vector (whatever axis that is), so the the north vector has to change sign so the sun is at the right position regarding north/south.
That's basically it - it really takes less time to fix it than to find it - so please, NL...
Regarding sun rise and sun set, there might be a little issue left, but it looks like that basic fix should take of anything that happens betwenn 1 hour after sunrise and 1 hour before sun set.
Kabe
These test were run with Cinemaxwell, but the principle and the texture used should work in any 3D app. All astronomical data are from http://www.calsky.com
So first I build a sun dial to read out the sun position in terms of rectacension (hour angle) and declination (~height). This was just a bitmap with circles and lines calculated for the different angles. You can download it here (1 MB):
http://klausbusse.de/Temp/Maxwell/TangensMap.zip
The fat circles are 5° lines, with the 15°, 30° marked in orange and the 45° marked in blue. Starting with 60° (which is again marked orange) every degree is marked with a thin circle. Combined with a proper cone to cast the shadow you can get the sun angles from the rendered image with enough precision to know what's going on. The cone has to have the same length as the distance of the blue circle and the center. Get a complete Cinema file here - 20 k, remember that you have to reassign the texture to the material!:
http://klausbusse.de/Temp/Maxwell/SunPosition.zip
Then I started rendering. To strip it down to the basics I started with a Latitude of 0 and GMT of 0. First I found out that the Cinema sun which I planned to use as a reference was hard to use, because it changed the hour angle based on Longitude and the current time settings of the local machine!
So, to get 12:00 for the Null meridian, I had to add 2 hours (which is my current time zone) and pu in 14:00 to make it work
Details see here: http://klausbusse.de/Temp/Maxwell/CinemaSunBug.jpg
Ok, then I looked up in Calsky the transit data for July 15th for that location, and came up with 71.5° at 12:06 for the transit. So I put in 12.1 for the time in Maxwell and rendered. Well, that was a loooong shadow I got here... about 62°, so the sun was at... (90-62=) 28°. That's was completely in line with my prvious observations that the shadows are much too long... Now I did the same with a longitude of -40 - and that was quite revealing:

That's interesting - the shadow is shorter (near 20°, so the sun was up at 70°+), and the image is much brighter - hey, that's it... actually it seems that someone flipped the wrong vector: The declination of the sun is calculated for the wrong hemisphere! In reality it's winter in the south hemisphere, so the shadow should be longer there, and the declinations match exactly what they should be in the other hemisphere!
Next I tried to get the influence of the month and found out that the month popup just do not work at all!
Then I checked for GMT compensation and latitude, and this seems to work ok as first tests show.
Sun rise and sun set are not calculated very well, the day seems a bit shorter - however, I think I'll test that later more thoroughly.
So, now everybody is invited to use this texture/scene to contribute more observations, and NL should make this work right after or while they fix the Cinemaxwell Mac beta...
It's not hard to fix, as the sun simulation is actually pretty good - there are two things to change:
The longitude coordinate must change sign to get to the correct hemisphere. As a side effect this will change the north/south vector (whatever axis that is), so the the north vector has to change sign so the sun is at the right position regarding north/south.
That's basically it - it really takes less time to fix it than to find it - so please, NL...
Regarding sun rise and sun set, there might be a little issue left, but it looks like that basic fix should take of anything that happens betwenn 1 hour after sunrise and 1 hour before sun set.
Kabe
Last edited by Kabe on Wed Jun 29, 2005 8:19 am, edited 3 times in total.