Slow or fast acquisition time


#1

Can I slow down or speed up the flow of time that I can get within oF?


#2

Sure.

float time = ofGetElapsedTimef();
float frequency = 2.0;
float amplitude = 1.0;

float yourValue = sin(time*frequency) * amplitude

Try to draw a circle using yourValue as radius. Try to change frequency and amplitude and look at how those affect your sketch.


#3

Thank you! !
This is a very interesting result! !

However, it seems to be a little different from the answer I am seeking.

Is there an equation that I am seeking to slow down (halve) or speed up (double speed) the speed of time flowing all the way?


#4

Yes, changing the frequency. It should be quite visible in the example. “the flow of time” is quite generic, please be more specific if this is not what you are looking for.


#5

It may be impossible to explain well because it is a beginner, but to get time with ofGetElapsedTimef () to double speed or halve!

For example, when giving a time axis with video such as ofGetElapsedTimef () etc., what kind of variable should be used to create a time value when you want to double speed or slow playback?


#6

Hi, to change video playback speed you can write like

yourVideo.setSpeed(0.5); // 50% speed

See videoPlayerExample for more details and how to control video.

If you want to change FPS, you can call,

ofSetFrameRate(30); // 30 fps

But this has no effect to video playback speed.