playMaker

Author Topic: Calibrate Tilt?  (Read 7813 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Calibrate Tilt?
« Reply #15 on: July 16, 2012, 08:23:14 AM »
Hi,

 ah yes... then you'll to stick with raw accelerations, but get inspired from the actual code for that action, in it it lerps the acceleration with a smoothing factor, so

 try this:

 lerp your acceleration against the smooth value and Time.deltaTime it will smooth out your values.

else, If you are ok with scripting, you can copy the device roll actions and extract other axis too.

bye,

 Jean


derkoi

  • Full Member
  • ***
  • Posts: 187
Re: Calibrate Tilt?
« Reply #16 on: July 16, 2012, 02:11:09 PM »
Thanks Jean,

I've decided to use a joystick for this game instead but I'm going to need this for a future game.  :)

aLDime

  • Playmaker Newbie
  • *
  • Posts: 24
    • http://aldimegame.com/
Re: Calibrate Tilt?
« Reply #17 on: August 31, 2013, 12:32:19 AM »
I was confused after your joint discussion)))))
Why quaternion? Why make things so complicated? Calibration is easier to go ...

Get Device Acceleration = > Store Y (X, (Z if need)) =>PlayerPrefs Set/Get Float (Y,X,Z)=> Get Device Acceleration (again) = > Float Subtract (float again-PlayerPrefs Get Float )=> Float Low Pass Filter == Rotate (X,Y, angle  (Z if need))!

Everything working clearly!

If you want I can put screenshots..

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Calibrate Tilt?
« Reply #18 on: September 10, 2013, 01:51:58 AM »
Hi,

 Cool. Actualy, if you have a working sample, that would be very good to share, so we can see how you do this properly.

 Thanks!

Bye,

 Jean