Smoothing jitter from Accelerometer returned values

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Is there any clever maths or functions that can be used on the numbers that get generated from the Accelerometer to smooth them out?

    The Accelerometer is so sensitive that even when holding it still the values are constantly changing, so I'm looking for a way to dampen/smooth simplify the numbers it generates.

    Thanks.

  • Is there any clever maths or functions that can be used on the numbers that get generated from the Accelerometer to smooth them out?

    The Accelerometer is so sensitive that even when holding it still the values are constantly changing, so I'm looking for a way to dampen/smooth simplify the numbers it generates.

    Thanks.

    You could try 'lerping' (interpolating) the value - rather than directly referencing the X/Y values of the accelerometer for the new object's X/Y, you instead use something like

    newX = current X value + (Accelerometer X - current X value)*0.1

    the 0.1 can be adjusted - a lower value will lerp slower whereas a value closer to 0.99 will be instant.

    Here's an example (using a mouse):
    Please login to see this attachment.

    The downside to this though is bigger changes in values will take a little bit longer so depending on how you want your motion controls to feel they might be a little bit more 'sluggish' than an instant response, but you can fix this by having the lerping only happen for small changes in the accelerometer and instantly snapping for bigger values.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!