Studying the wikipedia page, it seems that if you want to rotate 180 Β° around z , then the corresponding rotation of Quaternion will be simple:
0 0 0 1
The key here is the formula
, where (w, x, y, z) = (a, b, c, d).
Indeed, since cos (90 Β°) = 0 and sin (90 Β°) = 1, replacing alpha by 180 Β° and u by (0, 0, 1) gives you (0, 0, 0, 1).
Change As the Christian noted, the upward direction should not be z , but can be any unit vector u = (x, y, z) (otherwise we normalize it by dividing by its norm). In this case, the corresponding 180 Β° rotation will be
0 xyz
Now, to apply this rotation to move around the object, say that you have the position wind direction of your camera's c_pos and c_dir , then simply (left) matches it with q = (0 xyz) and move the camera position accordingly. Sort of
c_dir = q * c_dir * q^-1 c_pos = 2 * o_pos - c_pos
where o_pos is the position of the object, and c_dir should be converted to a quaternion with the real part 0.