Tutorials for steering wheel like control from accelerometer readings?

vipasanevipasane Member Posts: 34

Video example that illustrates my goal here.

Any tutorials or templates exists regarding this matter?

Comments

  • jigglybeanjigglybean Member Posts: 1,584

    You can download this free template over at GSHelper. It may be a good start

    Like Balls? Then click here! We've 100 coming soon

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Accelerometer is a tricky little bugger. Wish we had access to the gyroscope.

  • vipasanevipasane Member Posts: 34

    @The_Gamesalad_Guru
    Yes that is a bummer. Are you stating also that euler angles and quaternions since of the 2D nature of GS?

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    I have an accelerometer tutorial linked below, it's not specifically about steering control, but you might find it helpful.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited July 2015

    @vipasane said:
    The_Gamesalad_Guru
    Yes that is a bummer. Are you stating also that euler angles and quaternions since of the 2D nature of GS?

    No what i mean is the accelerometer only gives output of the velocity at which a device is being turned in a direction. It's not a locked in thing like the gyroscope which gives feedback on the angle of orientation.

  • tintrantintran Member Posts: 453
    edited July 2015

    I tried using the accelerometer for my game and well I find it jumps around alot even when the phone is left sitting still on the table.

    It's probably only good for checking condition for accelerating since it's jumping around accelerating over time missing a few calls you don't really notice the jumping around of the values.

    But if you want to use accelerometer directly...the object that's being controlled will shake around and twitches.

    I wonder if there's a way to use math to stabilize the jumping values so that when you use it the stabilized values so it doesn't jump unless you actually changed the tilt.

    I am not sure if i am even explaining it right...if you want to know what i mean, just create an empty project and print out values of accelerometer and you'll see that the values will jump around all the time...not sitting still in one place. ever.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited July 2015

    But if you want to use accelerometer directly...the object that's being controlled will shake around and twitches.

    I don't know about that, it might be the behaviors you created. I used the accelerometer in my demo above and used that exact same method in a labyrinth style game and it worked out great. You can control the ball very smoothly and there is no jumpiness or weirdness to it at all, I was actually pleasantly surprised.

  • tintrantintran Member Posts: 453
    edited July 2015

    @jamie_c said:
    I don't know about that, it might be the behaviors you created. I used the accelerometer in my demo above and used that exact same method in a labyrinth style game and it worked out great. You can control the ball very smoothly and there is no jumpiness or weirdness to it at all, I was actually pleasantly surprised.

    You can just create an empty project and print out accelerometer and see the values jump around... maybe yours work because it's over time and averaged it out okay. But for real the values do twitch around.

    To see the value really jump around, either print out the values, or move an actor's position based on accelerometer instead of accelerate...accelerate happens over time so it hides this twitching effect.

    I am looking into how to stabilize this value (looking into using averages) for now and see if that helps

  • tintrantintran Member Posts: 453

    Found solution to this with Low Pass Filter mentioned here:
    forums.gamesalad.com/discussion/53471/accelerometer-movement-done-right/p1

  • vipasanevipasane Member Posts: 34

    @jamie_c thanks that is helpful for someone who hasnt used accelerometer before.
    I have made few games with accelerometers and now I was trying to put myself out from my comfort zone have realized it is too much.
    With euler angles and quaternions I could do this, just cant figure out proper formula to calculate out tilting angles on each axis.
    And yes I was lazy in trigonometry during high school.

Sign In or Register to comment.