I’m using Defold Gyro - The gyroscope extension to get the angle of the Phone, but it is in a quaternion.
I use this script to turn it in to degrees, but I want to just have two cordinates. The Up and side
rotations. Right now the z roation is the side rotation (like a compass), but I can’t combine the y and x to get the hight (How much you look up) in any way plz help. (I use http://quaternions.online/)
local quat = vmath.quat(quatx, quaty, quatz, quatw)
local rot = quat
self.yrot = math.atan(rot.y/rot.w)*2
self.xrot = math.atan(rot.x/rot.w)*2
self.zrot = math.atan(rot.z/rot.w)*2
-- math.deg(self.zrot) For degrees