0

I have created a 3D environment in three.js and in the middle of the environment is the 3D cubic object. And there is a ambient light and a directional light to simulate the sun light

    var k = 3;
    var ambient_light = new THREE.AmbientLight(0x111111);
    var sun_light = new THREE.DirectionalLight( 0xfff1e0, 1.5);
    sun_light.position.set(1000 * k, 100 * k, -200 * k);

so now I want to make the environment light more dynamic like a whole day and night, with the sun rise from the east and go down to the west, and also simulate a bit at the dark night. To simulate that, I suppose when it comes to the night, most time it is about setting the intensity to be lower. and when it comes to the day, the directional Light need to change the position from time to time, but now I just don't know how would I set the position in different times of the day

user824624
  • 5,399
  • 16
  • 82
  • 144
  • 1
    take a look at http://stackoverflow.com/questions/8708048/position-of-the-sun-given-time-of-day-latitude-and-longitude – gaitat Oct 22 '14 at 19:10
  • I don't exact the position of sun in the given time, I just want to simulate the approximate sun light change in the day. – user824624 Oct 22 '14 at 20:48
  • I think gaitat had made a good answer. just use the linked function to calculate 10 sun positions and use these. Or i have to ask you: Wich time of year? nort or south of the equator? how far north or south of the equator? how many su npostions ... and at what times? :) – Benedikt Oct 23 '14 at 09:21

0 Answers0