Yes I was already doing that but your post helped me anyway, I was forgetting to scale the sundownhour appropriatly. She now works perfectly, well maybe not perfect... Still a little off.
//determine the per hour change
float fPerHour = 2*PI / 23.0f;
float fPerMinute = fPerHour / 60.0f;
float fSunDownHour = 17.0f * fPerHour;
m_fSunlightAmount = (sin((fHour*fPerHour + fMinutes*fPerMinute) + fSunDownHour) + 1)/2;
m_fSunsetAmount = (sin((fHour*fPerHour + fMinutes*fPerMinute) - fSunDownHour) + 1)/2;
This is a smart concept for the use of sin, I think you've taught me something I'll use again.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement