smooth ?

Hello, i been learning openframeworks theses days, before i was working with puredata and gem for opengl graphics, in gem theres an object called smooth , this object allows to smooth variables or easing, for example if i connect an gui element to a smooth object , the numbers that comes out from smooth are smoothed or with easing, this is good for contrilling movements with guis, because the movements are not hard , I would like to know if there is a method in openframeworks for doing this, if not, how can i make this in of?

is there is an easy way?

thanks

Hello,

one simple way of adding an elastic lag kind of effect, would be the following:
for instance say you are tracking the mouseX property (replace with gui slider value in your case).

you could have something like

  
  
float smoothedValue;  // declared in testApp.h  
  

and then in the update function of testApp.cpp

  
  
smoothedValue = 0.8f * smoothedValue  +  0.2f * mouseX;   // play with coefficients to modulate effect  
  

hope this helps

regards

david