This is my response to a user on Mathematica Stack Exchange who “came across a beautiful animation of a Möbius torus” and was “hoping someone can help ... make this animation in code”.
Below is the code for Möbius Torus animation. I have added a hacky “glow” to the polygons by adding partially transparent polygons slightly above the white polygons to give them some kind of “volumetric glow”. I have tweaked the lighting settings a bit to give the image a bit more depth.
The color function to be used by the animation
In[]:=
colorfunc=Blend[{{0,RGBColor[2/17,8/51,26/51]},{0.9,RGBColor[7/51,176/255,188/255]},{1,RGBColor[1,1,1]}},#]&;​​BarLegend[{colorfunc,{0,1}},LegendLayout->"Row"]
Out[]=
For each polygon, generate a random function moving between 0 and 1 over the interval from 0 to 2π
In[]:=
Clear@colors;​​colors[i_,j_]:=colors[i,j]=(SeedRandom[ToString[{i,j}]];(*makeoutcomepredictable*)Interpolation[ReplacePart[#,{-1,2}->#[[1,2]]]&@Table[{x,RandomReal[]},{x,Subdivide[0,2π,8]}],PeriodicInterpolation->True])
Precompute the rotation matrices for improved performance
rx=Evaluate@RotationMatrix[#,{1,0,0}]&​​ry=Evaluate@RotationMatrix[#,{0,1,0}]&​​rz=Evaluate@RotationMatrix[#,{0,0,1}]&
Out[]=
{{1,0,0},{0,Cos[#1],-Sin[#1]},{0,Sin[#1],Cos[#1]}}&
Out[]=
{{Cos[#1],0,Sin[#1]},{0,1,0},{-Sin[#1],0,Cos[#1]}}&
Out[]=
{{Cos[#1],-Sin[#1],0},{Sin[#1],Cos[#1],0},{0,0,1}}&
In[]:=
Manipulate[With[{pt=Mod[If[#2==m+1,l,0]+#-1,n]+Mod[If[#==n+1,k,0]+#2-1,m]n+1&},Graphics3D[Dynamic@GraphicsComplex[Catenate@Catenate@Table[(*generatethepoints*)rz[2π(i+lj/m)/n].({1,0,0}+rx[u].({1,1,1/Cos[u]}ry[2π(j/m+(k/m(i+lj/m))/n)+t].{sr,0,0})),{s,Subdivide[1,1.2,6]},(*addscaledversionsofthepolygonforthegloweffect*){j,m},{i,n}],{EdgeForm@{Thick,Black},Table[With[{i=i,j=j},Catenate@Table[If[s==0||#>0.9,{(*ifthebrigthnessis>0.9,enablethevolumetricglowbyshowingthescaledpolygons*)If[s>0,Splice@{EdgeForm@None,Opacity[5(1-s/8)(#-0.9)]},{}],Polygon[(*specifythepolygonsusingthepointsabove*){pt[i,j],pt[i+1,j],pt[i+1,j+1],pt[i,j+1]}+snm,BaseStyle->{colorfunc[#],Glow@GrayLevel[#^10]}]},{}]&@colors[i,j][t],{s,0,6}]],{j,m},{i,n}]}],ViewPoint->({0.3,0,1};{0,0,∞}),ViewVertical->{0,1,1},Boxed->False,SphericalRegion->True,Background->Darker@RGBColor[2/51,8/51,26/51],PlotRange->2,Lighting->{{"Point",White,{-1.6,1.6,1}},{"Point",White,{-1.6,1.6,1}},{"Ambient",GrayLevel@0.3}}]],{{n,16},3,20,1},(*twist-offsetalongthebigcircle*){{m,6},3,10,1},(*twist-offsetalongthesmallcircle*){{k,6},-10,10,1},(*animationtime*){{l,0},-3,3,1},(*tiltofthesmallcircles*){{t,π/4},0,2π,AnimationRate->0.1,Appearance->"Open"},(*z-rotationoffsetfortheinneredgeofthetorus*){{u,-π/4},-π/4,π/4},(*z-rotationoffsetfortheouteredgeofthetorus*){{r,0.4},0.1,0.9},(*radiusofthesmallcircle*)ControlPlacement->Left]

CITE THIS NOTEBOOK

Creating Möbius Torus animation​
by Lukas Lang​
Wolfram Community, STAFF PICKS, September 26, 2023
​https://community.wolfram.com/groups/-/m/t/3022146