I tried a forum search for “llGetSunDirection” and did not get any results. From what I can understand in the wiki it returns a vector, where each of the three parameters range from –1 to +1. I could not find an example of its use. I assume z would be the height of the sun where a positive value would be day and a negative would be night. But what about x and y. If the sun were to the southwest, (135 degrees clockwise from east), would x = 0.5 and y = -0.5?
I’m trying to create a stain glass window in which the inside texture is full-bright during the day and the outside texture is not full-bright. At sunset I want it to be reversed as if the light source was in the inside. So I only need to know the general direction of the sun and the sign of the vector’s z value may be all I need. I read about reading the llGetTimeOfDay but it also said if the Sun is stopped by the private island owner the clock will continue to count thereby possibly causing my script to think it’s night when the sun is actually still out.
Thanks
This is how someone would build a clock telling time from the sun in SL. I built one a long time ago, used some trig and llGetSunDirection, works nicely. Also very nice to cast shadows on stuff. IE automatic shadows