N
N
Nikolai Trifonov2016-04-19 08:54:40
C++ / C#
Nikolai Trifonov, 2016-04-19 08:54:40

How to make a short winter day?

There is a directional light and a script for it:

void Start () {

        latitude = degrees + ((double)minutes / 60) + ((double)seconds / 3600);
        inclination = 23.5 * Mathf.Sin((360 * (currentDay - 81)) / 365);
        solarAzimut = latitude - 23.5 - inclination;

        transform.rotation = Quaternion.Euler(360-(float)solarAzimut, 180, 0);
    }
  
  void Update () {
        transform.Rotate(Vector3.up, DayLength * Time.fixedDeltaTime);
  }

The script describes the change in the position of the Sun during the seasons.
The problem is that the length of the day and night are always equal to each other.
How can I change the directional light?
An illustration of what I want to do
bf86fc400477.gif

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Trifonov, 2016-04-19
@fridriekh

That's it, I understand.
It is necessary to make the movement of the sun along an elliptical trajectory

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question