Skip to content

Instantly share code, notes, and snippets.

@ofZach
Created December 2, 2013 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ofZach/7746935 to your computer and use it in GitHub Desktop.
Save ofZach/7746935 to your computer and use it in GitHub Desktop.
// was noticing sin(ofGetElapsedTimef()) gets crunchy at some point, because of lower resolution in sin / cos. here's an alternative function that seems to help... not tested for speed.
float ofGetElapsedTimeForSin(){
long long timeNow = ofGetElapsedTimeMillis();
long long modForTwoPi = (int)(TWO_PI*1000.0);
return ((float)(timeNow % modeForTwoPi)/1000.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment