> x:=(theta,phi)->(R+r*cos(phi))*cos(theta):
y:=(theta,phi)->(R+r*cos(phi))*sin(theta):
z:=(theta,phi)->r*sin(phi):

> R:=2:r:=1:

 

> n:=20:
display(seq(plot3d([x,y,z],0..2*Pi,0..2*Pi,view=[-R-r..R+r,-R-r..k*(R+r)/n,-r..r]),k=0..n),insequence=true,style=patchnogrid,scaling=constrained);