7
$\begingroup$

What's the best way to use Mathematica built-in tools to stack multiple frames of a ListAnimation vertically into a pleasing 3D picture?

ClearAll["Global`*"]; SeedRandom[1]; d = 4; (* dimensions *) numSteps = 75; (* number of rotation steps per frame *) numFrames = 25; (* number of frames *) (* isoclinic rotation of theta in the basis of P *) isoclinic[theta_, P_] := Module[{simple, composite, R}, simple = Table[R[i] -> RotationMatrix[theta], {i, d/2}]; composite = ArrayFlatten[DiagonalMatrix[Array[R, d/2]] /. simple]; P . composite . P\[Transpose] ]; (* list of eigenvalues obtained from rotating given matrix in basis P \ *) eigenTrajectory[mat_, P_] := ( Table[ Eigenvalues[mat . isoclinic[theta, P]], {theta, 0, 2 Pi, 2 Pi/numSteps}] ); (* Random basis *) P0 = RandomVariate@CircularRealMatrixDistribution@d; (* random complex matrix with eigenvalues approximately in unit \ circle *) genMat := RandomVariate[NormalDistribution[], {d, d}]; mat = (genMat + I genMat)/Sqrt[2 d]; plot[vals_] := ComplexListPlot[vals, PlotRange -> 1.2*{-1 - I, 1 + I}, Axes -> None]; curveFrames = Table[plot[ Flatten@eigenTrajectory[mat, isoclinic[theta, P0]]], {theta, 0, 2 Pi, 2 Pi/numFrames}]; ListAnimate[curveFrames] 

enter image description here

Background:

$\endgroup$
7
  • $\begingroup$ What do you mean, "coherent 3D picture"? Stacking and playing them as a sequence (as you've shown) doesn't seem to be a "coherent 3D picture", any more than other 2D animations. $\endgroup$ Commented Jan 3 at 18:17
  • $\begingroup$ @DavidG.Stork I mean visualize as a 3D shape, rather than a 2D animation $\endgroup$ Commented Jan 3 at 18:20
  • $\begingroup$ @DavidG.Stork so for instance in higher resolution here you would expect the 3d version to start with "4 tubes" which eventually merge/split into a different set of 4 tubes $\endgroup$ Commented Jan 3 at 18:21
  • $\begingroup$ I would have thought a "3D picture" is in a static 3D representation (e.g., Graphics3D or Plot3D), so you can grab and rotate it, zoom in, and so on. $\endgroup$ Commented Jan 3 at 18:38
  • 1
    $\begingroup$ One approach might be this: mathematica.stackexchange.com/q/95569/731 $\endgroup$ Commented Jan 3 at 22:26

1 Answer 1

9
$\begingroup$

With numFrames = 100:

With[{frames = Normal /@ curveFrames,(* remove Highlighting *) n = Length@curveFrames}, Graphics3D[{Opacity[0.7], Table[ frames[[k, 1]] /. (* get graphics primitives *) Point[pp_?MatrixQ] :> Point[PadRight[pp, {Automatic, 3}, (* make 3D *) Rescale[k, {1, n}, {0., 2. Pi}]] (* map index to theta *) ], {k, n}] }] ] 
$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.