# Rotate viewpoint around axis

I'd like to know why I can't rotate this all the way around in a circle. The view flips rather than turning upside down, when trying to rotate about the Y-axis:

g = Graphics3D[{Blue, Cylinder[], Red, Sphere[{0, 0, 2}]}];
Manipulate[Graphics3D[g[[1]],
ViewPoint -> RotationTransform[i*2 \[Pi], {0, 1, 0}][{1, 0, 0}],
SphericalRegion -> True, Boxed -> False, Axes -> False,
ViewAngle -> Automatic], {i, 0, 1}]


Confusingly, this approach works just fine for rotating around the Z-axis!

g = Graphics3D[{Blue, Cylinder[], Red, Sphere[{0, 0, 2}], Line[{{-2, 0, 2}, {2, 0, 2}, {0, 0, 4}, {-2, 0, 2}}]}];
Manipulate[Graphics3D[g[[1]], ViewPoint -> RotationTransform[i*2 \[Pi], {0, 0, 1}][{1, 0, 0}], SphericalRegion -> True, Boxed -> False, Axes -> False, ViewAngle -> Automatic], {i, 0, 1}]


• Do you have to include the viewvertical here? – M.R. Feb 1 at 6:51
• Closely related: 42314 – Kuba Feb 1 at 10:19
• It works for the z axis, but not the x or y... – M.R. Feb 1 at 17:41

You have to include the ViewVertical in your transformation. Otherwise, the camera just flips around.
g = Graphics3D[{Blue, Cylinder[], Red, Sphere[{0, 0, 2}], Green,