User Tag List

Results 1 to 6 of 6

Thread: How to reset Accellerometer base orientation

  1. #1
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    How to reset Accellerometer base orientation

    I am looking for a way to reset the accellerometer's 0,0,0 orientation. Normally, it happens when the frame starts. But if the player was holding the device at an awkward angle when the accelerometer initializes, then I need a way for them to re-initialize it. I want to have a button in my pause menu that simply resets 0,0,0 of the accellerometer to the current device orientation.

    Can anyone suggest how I would accomplish this?

    Thanks,

    Mobichan

  2. #2
    Clicker Multimedia Fusion 2 Developer
    Diego's Avatar
    Join Date
    Aug 2007
    Location
    Brazil
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At the beggining of the frame you should save the actual accelerometer numer of each angle on respective variable. Let's say for instance calibx, caliby and calibz
    Then when you use it to move an object or whatever, you should subtract this value from the calculation

    Example:

    ball.y = ball.y + accelerometer.y - caliby

    I think that should do in some cases, i just dont know if you need to use ABS() at some point.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    The problem here is that once your phone tilts past a certain point the numbers start counting in the opposite direction. In Hungry Beetle I gave the users a calibration screen where they had to tilt their phone to find the 'sweet spot' before starting the game, Super Monkey Ball style.

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    Yeah, my game only needs tilting left and right, so I simply compare the current tilt value in x to be greater than 0.02 or less than -0.02. The problem comes if the user was holding the phone sideways when the frame starts, then the orientation of the accelerometer will be sending values that are not comfortable to the user. I need the user to be able to reorient the device mid-game and force the accelerometer to re-initialize its values. And I would like to do this without restarting the frame.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Weird, in my Hungry Beetle game it doesn't re-calibrate at the start of the frame...

    Might be something CT could do in an update, depending on how the accelerometer works.

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    From the help file, I got the impression that MMF intitalized the accelerometer on Start of Frame. Might be a misinterpretation on my part. Does anyone else know how MMF handles this?

Similar Threads

  1. Reset angle?
    By Warmachine in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 23rd June 2013, 05:40 PM
  2. Now to reset INI file?
    By 1234cb in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 10th June 2013, 05:04 AM
  3. How to reset the Hi-Score ?
    By vesperillo in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th October 2007, 06:30 PM
  4. Reset Highscores
    By aaron in forum The Games Factory 2 - Technical Support
    Replies: 1
    Last Post: 2nd October 2007, 07:02 AM
  5. disabeling the f2 reset feature
    By BrashMonkey in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 24th August 2007, 08:03 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
  •