User Tag List

Results 1 to 5 of 5

Thread: Smoothing jitter from Accelerometer returned values

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2016
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smoothing jitter from Accelerometer returned values

    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.

  2. #2
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    103
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by migwah View Post
    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):
    lerping.mfa

    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.

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2016
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Marbenx, sounds like something I can try, appreciate the help!

  4. #4
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    103
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    No worries, hope it works out!

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Christian_Wheel's Avatar
    Join Date
    Mar 2010
    Location
    Los Angeles
    Posts
    322
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What you're asking for is called a low-pass filter. You can find some decent algorithms written in Javascript which you could actually just plug-and-play into your Fusion project (depending on Runtime) by using the web view object.

Similar Threads

  1. Location object: what to do with returned values?
    By fujiwara_no_sai in forum Fusion 2.5
    Replies: 11
    Last Post: 3rd December 2017, 12:35 AM
  2. Procedural terrain with edge smoothing
    By SolarB in forum Guides, Tutorials, Examples, Widgets
    Replies: 1
    Last Post: 30th April 2014, 08:48 PM
  3. B13: Accelerometer values different to iOS in landscape mode
    By AndyH in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 25th January 2012, 11:59 PM
  4. Font smoothing
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 17th April 2010, 01:28 PM
  5. Font smoothing
    By DJFuego in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 6th March 2009, 03:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •