I'm having problems calculating something that should be simple too. I'm trying to pass back a sine loop with a specified wavelength and amplitude.
The idea is to return a smooth value for texture manipulation ( texture positioning, scaling, etc. )
I'm using
TimePeriod is constant and CurrentTime is always >0 and <=TimePeriod. Both in Milliseconds.
It's almost ok, but it kinda "bumps" as it cycles to a new period. It's not quite smooth at the end, as it is at the halfway point ( or possibly vice versa, I've watched this thing animate so many times, I'm dizzy! ) It's almost as though I'm cutting it off too soon. I'm taking it across a scale of 180 degrees though, which seems right, no?
The idea is to return a smooth value for texture manipulation ( texture positioning, scaling, etc. )
I'm using
Return Sin(Abs((TimePeriod/CurrentTime)*180.0-90))*Amplitude
TimePeriod is constant and CurrentTime is always >0 and <=TimePeriod. Both in Milliseconds.
It's almost ok, but it kinda "bumps" as it cycles to a new period. It's not quite smooth at the end, as it is at the halfway point ( or possibly vice versa, I've watched this thing animate so many times, I'm dizzy! ) It's almost as though I'm cutting it off too soon. I'm taking it across a scale of 180 degrees though, which seems right, no?