Hi Melchior,
 that was a good thread for me :-)
I've come to a good result finally. Now I have a Space Needle which lights
on when sun-angle-rad > 1.57 (dusk) and switches off when sun-angle-rad <
1.57 (during the day). And it does it gradually.

I have another simple question anyway. Do I brake something if I set
emission values higher then 1 or lessere then 0 for red,green and blue? It
works to me without problem but I don't like non compliant hacks if it may
be standardized by doing it in a good way.

My current solution is:
  <animation>
  <type>material</type>
  <object-name>pCylinder1_group5.0</object-name>
  <emission>
    <red>5.56</red>
    <green>0.0</green>
    <blue>0.0</blue>
    <offset>-8.72</offset>
    <factor-prop>/sim/time/sun-angle-rad</factor-prop>
  </emission>
  </animation>

I got those numbers by building a simple math function for Emission.
Let's say:
 sun-angle-rad is x
 emission is f(x)
I want the emission to be a linear function of x so that emission is a
positive value between 0 and 1 when the sun goes down the horizon.

Then the function describing the emission variation is:
 f(x) = x * red + offset

I want:
 f(1.57) = 0 (no emission when sun is still on the horizon)
 f(1.75) = 1 (full red emission when sun is a few degree under the horizon)

Solving the math problem I get
 red = 5.56
 offset = -8.72 

Now I come to my previous question.
By using such values I get
 f(x) > 1 when x > 1.75
 f(x) < 0 when x < 1.57

Are those values acceptable to flightgear? Even if it makes no sense to have
the red component of the emission color >1 or <0 (which are max and min
value)?

   Roberto

-- 
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to