POV-Ray makes it simple to automate the creation of a sequence of images. These images can then be easily merged into an animated gif using Photoshop.
In the animation on the left, we used POV-Ray to create 36 images of a torus rotated at 10degree intervals along a horizontal axis.