Device orientation and accelerometer axis (X, Y, Z)

xwrbnxxwrbnx Member Posts: 23

Hi,

I am new to GS, and am confused with the relation between device orientation, and accelerometer axis.
Sorry if my questions appear too basic. I don't have iDevice so I can't test.

  1. If the Device --> Screen --> Device Orientation is set to Landscape Left, does it means when we use iPhone the phone left side becomes at the bottom and the home button is on our right?
    Landscape Right means the phone right side becomes at the bottom and the home button is on our left?

  2. About Accelerometer.X, Y and Z, if we set device orientation to Portrait:
    Accelerometer.X is horizontal (left negative, right positive),
    Accelerometer.Y is vertical (up positive, down negative), and
    Accelerometer.Z is depth (forward positive, back negative).
    To make an actor move right, use condition Accelerometer.X > 0.01, set direction 0.
    To make an actor move up, use condition Accelerometer.Y > 0.01, set direction 90.
    Is my understanding correct?

  3. If device orientation is set to Landscape Left:
    The Accelerometer X, Y, and Z axis actually in the same real position but different to our relative.
    Accelerometer.X is vertical (up positive, down negative),
    Accelerometer.Y is horizontal (left positive, right negative), and
    Accelerometer.Z is depth (forward positive, back negative).
    To make an actor move right, use condition Accelerometer.Y < -0.01, set direction 0.
    To make an actor move up, use condition Accelerometer.X > 0.01, set direction 90.
    Is my understanding correct?

  4. If device orientation is set to Landscape Right:
    Accelerometer.X is vertical (up negative, down positive),
    Accelerometer.Y is horizontal (left negative, right positive), and
    Accelerometer.Z is depth (forward positive, back negative).
    To make an actor move right, use condition Accelerometer.Y > 0.01, set direction 0.
    To make an actor move up, use condition Accelerometer.X < -0.01, set direction 90.
    Is my understanding correct?

Sorry if the questions appear to be very basic but I just want to get the right understanding.

Thank you.

Sign In or Register to comment.