根据时间变化的太阳颜色的RGB值公式

   BYTE r, g, b;
   float C = 8.0f;


   // set sun
   r = (255-C/sqrt(1-cos(m_time))*0.03);
   g = (255-C/sqrt(1-cos(m_time))*0.75);
   b = (255-C/sqrt(1-cos(m_time))*0.97);
 

   // set sky
   r = (255-C/sqrt(1-cos(m_time))*0.73);
   g = (255-C/sqrt(1-cos(m_time))*0.05);
   b = (255-C/sqrt(1-cos(m_time))*0.07);

posted @ 2006-04-14 17:51  千里马肝  阅读(4496)  评论(1编辑  收藏  举报