2 fix order edited Oct 2 '17 at 22:07 Bram 3,2071111 silver badges1919 bronze badges qx = ax * sin(angle/2) qy = ay * sin(angle/2) qz = az * sin(angle/2) qw = cos(angle/2)  But since your vector represents the rotation, and is not the axis of rotation, we need to compute the angle. Your axis of rotation is just 0,1,0 angle = atan2( vector.zx, vector.z ) // Note: I expected atan2(z,x) but OP reported success with atan2(x,z) instead! Switch around if you see 90° off. qx = 0 qy = 1 * sin( angle/2 ) qz = 0 qw = cos( angle/2 )  NOTE: this even works for non-unit vectors, as atan2 will compute the correct angle for any length vector, as long as it is not zero. qx = ax * sin(angle/2) qy = ay * sin(angle/2) qz = az * sin(angle/2) qw = cos(angle/2)  But since your vector represents the rotation, and is not the axis of rotation, we need to compute the angle. Your axis of rotation is just 0,1,0 angle = atan2( vector.z, vector.x ) qx = 0 qy = 1 * sin( angle/2 ) qz = 0 qw = cos( angle/2 )  NOTE: this even works for non-unit vectors, as atan2 will compute the correct angle for any length vector, as long as it is not zero. qx = ax * sin(angle/2) qy = ay * sin(angle/2) qz = az * sin(angle/2) qw = cos(angle/2)  But since your vector represents the rotation, and is not the axis of rotation, we need to compute the angle. Your axis of rotation is just 0,1,0 angle = atan2( vector.x, vector.z ) // Note: I expected atan2(z,x) but OP reported success with atan2(x,z) instead! Switch around if you see 90° off. qx = 0 qy = 1 * sin( angle/2 ) qz = 0 qw = cos( angle/2 )  NOTE: this even works for non-unit vectors, as atan2 will compute the correct angle for any length vector, as long as it is not zero. 1 answered Sep 30 '17 at 22:14 Bram 3,2071111 silver badges1919 bronze badges qx = ax * sin(angle/2) qy = ay * sin(angle/2) qz = az * sin(angle/2) qw = cos(angle/2)  But since your vector represents the rotation, and is not the axis of rotation, we need to compute the angle. Your axis of rotation is just 0,1,0 angle = atan2( vector.z, vector.x ) qx = 0 qy = 1 * sin( angle/2 ) qz = 0 qw = cos( angle/2 )  NOTE: this even works for non-unit vectors, as atan2 will compute the correct angle for any length vector, as long as it is not zero.