Hi,
after check again,
I see my matrix is not correct, so I update it and use transformToGL();
Matrix matrix = new Matrix();
float x = mPquart[1];
float y = mPquart[2];
float z = mPquart[3];
float w = mPquart[0];
float[] dump = new float[16];
final float xx = x * x;
final float xy = x * y;
final float xz = x * z;
final float xw = x * w;
final float yy = y * y;
final float yz = y * z;
final float yw = y * w;
final float zz = z * z;
final float zw = z * w;
dump[0] = 1 - 2 * (yy + zz);
dump[4] = 2 * (xy - zw);
dump[8] = 2 * (xz + yw);
dump[12] = 0;
dump[1] = 2 * (xy + zw);
dump[5] = 1 - 2 * (xx + zz);
dump[9] = 2 * (yz - xw);
dump[13] = 0;
dump[2] = 2 * (xz - yw);
dump[6] = 2 * (yz + xw);
dump[10] = 1 - 2 * (xx + yy);
dump[14] = 0;
dump[3] = 0;
dump[7] = 0;
dump[11] = 0;
dump[15] = 1;
matrix.setDump(dump);
matrix.transformToGL();
I saw the object rotate different, but I still have a problem.
When I rotate my device on xAxis, it will rotate y or z, it only rotate properly when i put the device and my phone same direction.
Is there anything that I miss.
Thanks so much for support.