v = Tuples[{-1, 1}, 4];
e = Select[Subsets[Range[Length[v]], {2}], Count[Subtract @@ v[[#]], 0] == 3 &];
f = Select[Union[Flatten[#]] & /@ Subsets[e, {4}], Length@# == 4 &];
f = f /. {a_, b_, c_, d_} :> {b, a, c, d};
rotv[t_] = (RotationMatrix[ t, {{0, 0, 1, 0}, {0, 1, 0, 0}}].RotationMatrix[
2 t, {{1, 0, 0, 0}, {0, 0, 0, 1}}].#) & /@ v;
proj[t_] := Most[#]/(3 - Last[#]) & /@ rotv[t];
Animate[Graphics3D[GraphicsComplex[
proj[t], {Orange, Specularity[0.75, 10], Sphere[Range[16], 0.05],
Tube[e, 0.03], Opacity[0.3], Polygon@f}], Boxed -> False,
Background -> Black, ImageSize -> 390, PlotRange -> 1], {t, 0.0,
Pi/2.0, 0.075}]
有没有大神能简述一下这段代码是如何生成不停运动的超正方体
e = Select[Subsets[Range[Length[v]], {2}], Count[Subtract @@ v[[#]], 0] == 3 &];
f = Select[Union[Flatten[#]] & /@ Subsets[e, {4}], Length@# == 4 &];
f = f /. {a_, b_, c_, d_} :> {b, a, c, d};
rotv[t_] = (RotationMatrix[ t, {{0, 0, 1, 0}, {0, 1, 0, 0}}].RotationMatrix[
2 t, {{1, 0, 0, 0}, {0, 0, 0, 1}}].#) & /@ v;
proj[t_] := Most[#]/(3 - Last[#]) & /@ rotv[t];
Animate[Graphics3D[GraphicsComplex[
proj[t], {Orange, Specularity[0.75, 10], Sphere[Range[16], 0.05],
Tube[e, 0.03], Opacity[0.3], Polygon@f}], Boxed -> False,
Background -> Black, ImageSize -> 390, PlotRange -> 1], {t, 0.0,
Pi/2.0, 0.075}]
有没有大神能简述一下这段代码是如何生成不停运动的超正方体