Announcement

Collapse
No announcement yet.

Sun motion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sun motion

    Hello,

    I want to make "sun motion" with use DirectionalLight in Bs_Sky_Sphere,
    but there will always be the Equinox. You can of course change the speed of movement during the day and at night and get a different value.

    But is it possible to shift the axis of rotation sun of 23.5 degrees (picture)? And how to do it?

    Click image for larger version

Name:	image056.jpg
Views:	1
Size:	11.3 KB
ID:	1188102

    #2
    Yes. The biggest issue I ran into was the angle. When I rotated to my desired angle for more realistic shadows, not the straight down on the equator shadows you get by default, I could no longer get the same darkness on the skysphere and rotating it would change the rotation on all three axis. I mapped out the rotation of the sun using clock times as well as angles 0, 6, 12, 18 == 0, 90, 180, 270. I documented the angles of my Directional light at each of these times, initially it was linear. I created a timeline and used a vector output that would set the angle at the time of day. You could shorten your timeline, but I used a second for each second of the day. You could do minutes or whatever. So every tick in my game I get the system time and I set the time on the timeline to the same. My sun is always where it should be. The other issue that is spawned from this is how dark it will not get. Because of this angle, the computation in the skysphere never gets to the point it should. Using the same timeline I created a float that handled the angle. This can be set to a nice curve to give a bit more daylight in the sky or less. Output this and set the variable in the skysphere. You also have to call updateSkysphere or something like that for it to change color; just setting the rotator will not update the sphere.

    Comment

    Working...
    X