accelerometer for physical horizon?

havardmhavardm Member Posts: 8
edited November -1 in Working with GS (Mac)
Hi,
I'm a new user. GS is interesting and great fun. I am trying to make a "water" type thing, that behaves as if the iphone was filled with water. How can I use the accelerometer to move the object to the right angle?

thanx
h

Comments

  • havardmhavardm Member Posts: 8
    I mean: To move the "waterline" object to the right angle.
  • ChaserChaser Member Posts: 1,453
    Jar aquik theory as I'm at work. When accelerometer is y or X is >.08 rotate clockwise and when x or y <-.08 rotate counterclockwise
    Problem comes when you want rotation to stop, so maybe use interpolate and base the change in degrees on the accellerometer
  • Rob2Rob2 Member Posts: 2,402
    ((game.Accelerometer.Y+1)*360)/2 should start you off in the right direction :)
  • havardmhavardm Member Posts: 8
    Great, will try these two now. Thanks a lot!
  • Rob2Rob2 Member Posts: 2,402
    sorry should have been /4 ((game.Accelerometer.Y+1)*360)/4 and that just gives you some way of converting the range -1 to 1 of the Y part of the accelerometer into a useful angle it was a bit late last night and I haven't looked at it further.
Sign In or Register to comment.