Measuring force using the accelerometer...

CaptMediaCaptMedia Member Posts: 60
edited November -1 in Working with GS (Mac)
Is there any way to use the accelerometer to measure force/speed of the device in GameSalad? Thanks

Comments

  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    As in how fast you tilt the device?

    Ace
  • old_kipperold_kipper Member Posts: 1,420
    The accelerometers put out a readings that gives out acceleration, but not maintained speed. If the device is moving a continuous speed in any one plane the reading will remain static in that plane. This is different for rotation. You can check the rotational speed of the device by sampling the rotational angle and using timers to check again a few moments later, and then checking the difference.
  • CaptMediaCaptMedia Member Posts: 60
    I am wondering how to measure the force of a punch, by holding the device in your hand and punching. Is there anyway to retrieve the speed the device is traveling when the punch is complete.
  • old_kipperold_kipper Member Posts: 1,420
    I doubt you would get this app past Apple as the guidelines mention apps that physically endanger the device as a no no.
  • CaptMediaCaptMedia Member Posts: 60
    Anyone?
  • old_kipperold_kipper Member Posts: 1,420
    If you insist on doing this, you can catch the accelerometer maximum output by having a real number attribute, and using rules that say if the accelerometer reading is greater, or lesser than (dependant on if it is a positive or negative value, which is in turn based on the direction of the movement) than the value in the real number attribute, then change the value to the accelerometer value. To calibrate your 'game' you might use a speed radar or pop your device in a cannon that you know the muzzle velocity of, or even put it in a jet fighter or dragster where a system is in place to record the acceleration/speed. It might be better to use a range of world class boxers just to get readings from and set up percentages from, but you still will be putting the device in peril so as I said before- I doubt you will be getting it past Apple, and if you fling you new Iphone 4s across the room in testing it may serve little purpose other than offering you an insight to the internal components used. There are some horsepower estimating apps out there that use this sort of thing, but they are set up for the device to be fixed inside a car.

    You could take the opposite approach and make a game that has fail triggers based on very small movements of the device, while still needing to move an accelerometer controlled object around.
  • CaptMediaCaptMedia Member Posts: 60
    For anyone who cares,
    1.0 in accelerometer units = 3 feet/second
    I have come to this conclusion through testing, but do not take it as 100% on track, I estimated and rounded the values a great deal, but it gives you an idea.
Sign In or Register to comment.