Hello guys Im programming a gauge animation where there is a needle that points to certain values

lets say each value equals to the amount of degrees the needle has to rotate to reach said value

what I want to do is to introduce a certain vibration value to the needle so its never working smoothly

any ideas?

  • \$\begingroup\$ At given intervals, pick targets with an random offset to the real value, using a normal distribution. Then animate that needle going to that target instead of going to the real value. Ern... I am rusty in C++. \$\endgroup\$ – Theraot Feb 28 '18 at 0:16
  • \$\begingroup\$ i think i understand, what exactly you mean by "at given intervals"? \$\endgroup\$ – EvilNando Feb 28 '18 at 3:55
  • \$\begingroup\$ @EvilNando every so often :) \$\endgroup\$ – Quentin Feb 28 '18 at 15:43
  • \$\begingroup\$ You can pick a target every frame, however that can be too much. Instead you can pick it each x milliseconds, that is the given interval. Edit: I am suggesting something based in time instead of frame so that it is independent from the frame rate. You play with that value and see what looks better. Another thing to play with is the variance (Edit: I mean, the dispersion) of the distribution. \$\endgroup\$ – Theraot Feb 28 '18 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.