How to create pulsating value from 0..1..0..1..0 etc for a given duration?

Posted by pollux on Stack Overflow See other posts from Stack Overflow or by pollux
Published on 2010-06-10T21:11:10Z Indexed on 2010/06/10 21:12 UTC
Read the original article Hit count: 233

Filed under:
|
|
|
|

Hi

I'm working on some code where I have a Time object with a member time. Time.time gives me the time since my application started in seconds (float value). Now I want to create a pulsating value between 0 and 1 and then from 1 to 0 again, which continues doing thins untill the application stops.

I was thinking to use sin() but don't know what to pass to it as paramters to create this pulsing value.

How would I create this pulsating value?

Kind regards, Pollux

© Stack Overflow or respective owner

Related posts about c#

Related posts about c++