The problem.
The rotation animations generated by the current setup tend to "look 3d" in the sense that it's hard to tell that the rotating forms couldn't be embedded isometrically in 3-space.
It would be nice to generate some special rotations that make it clear in the animation that we're witnessing something coming from a higher dimensional space. For example, something like we see in this video.
Discussion.
This animation and many similar videos tend to use the tesseract (or perhaps another regular 4d polytope). The polytopes in our library are generally not regular. Anecdotally, many of them tend to have the first four vertices the standard basis vectors of $\mathbb{R}^4$ (that is, the first four vertices of the standard 4-simplex), but also some vertices that "stick out" much further from the origin. Rotating such shapes will necessarily move the "sticking out" vertices much more quickly than the vertices close to the origin. Thus, regardless of how we set it up, these animations will look qualitatively different from the hypercube ones.
What about this "turning inside out" effect? When we project from 4d to 2d we "project out" a family of 2-planes (i.e. any two points in one of these 2-planes get mapped to the same point in the projection). In particular there's a specific 2-plane $K$ that projects to the point $(0,0)$ (the origin) in the viewing plane. Now, if we rotate the polytope in such a way that a point in $K$ stays in or close to $K$, then in the projection we only see the vertices moving "towards" or "away from" the viewer without much lateral movement. More precisely, we get a perspective effect where points rotating away from the viewer appear to move closer to the origin while points moving towards the viewer move away from it.
To get a truly "inside out" effect, vertices moving away from the origin have to move right past vertices moving towards the origin. This is tricky because vertices may have substantially different distances from the origin for other reasons, e.g. because they sit at different distances in 4-space. It's easier to get this visual effect when we have a decent number of vertices that are a similar distance from the origin in 4-space but very different distances from the viewing plane.
Status quo.
The animations in the notebook are generated by applying a transformation
vertices_projected = project_2d(vertices @ B @ R(theta) @ A)
or, in mathematical notation, $v_o = \pi( B^T\cdot R(-\theta)\cdot A^T\cdot v_i)$. Here $R(\theta)$ is rotation by $\theta$ in the first two coordinates (i.e. around the axis $\langle e_3, e_4\rangle$) and $\theta$ is a parameter that we slide along the range $[0,2\pi)$ in order to generate the animation frames.
Currently, $A$ and $B$ are generated randomly. Clearly, random rotations do not generate the images we want.
Solution.
Try to figure out ways to generate "interesting" rotations.
Examples:
-
$A=I_4$, i.e. project out the plane of rotation. This generates animations where the vertices tend to move "in and out" but not "inside out," that is, inner vertices and outer vertices do not overtake one another.
- Pre-rotate so that the plane spanned by the first three vertices is parallel to $K$. That is:
B = np.array([
[-1,0,1,0],
[0,-1,1,0],
[0,0,1,0],
[0,0,0,1],
])
This seems to get the vertices close to the origin to appear to move past one another.
The problem.
The rotation animations generated by the current setup tend to "look 3d" in the sense that it's hard to tell that the rotating forms couldn't be embedded isometrically in 3-space.
It would be nice to generate some special rotations that make it clear in the animation that we're witnessing something coming from a higher dimensional space. For example, something like we see in this video.
Discussion.$\mathbb{R}^4$ (that is, the first four vertices of the standard 4-simplex), but also some vertices that "stick out" much further from the origin. Rotating such shapes will necessarily move the "sticking out" vertices much more quickly than the vertices close to the origin. Thus, regardless of how we set it up, these animations will look qualitatively different from the hypercube ones.
This animation and many similar videos tend to use the tesseract (or perhaps another regular 4d polytope). The polytopes in our library are generally not regular. Anecdotally, many of them tend to have the first four vertices the standard basis vectors of
What about this "turning inside out" effect? When we project from 4d to 2d we "project out" a family of 2-planes (i.e. any two points in one of these 2-planes get mapped to the same point in the projection). In particular there's a specific 2-plane$K$ that projects to the point $(0,0)$ (the origin) in the viewing plane. Now, if we rotate the polytope in such a way that a point in $K$ stays in or close to $K$ , then in the projection we only see the vertices moving "towards" or "away from" the viewer without much lateral movement. More precisely, we get a perspective effect where points rotating away from the viewer appear to move closer to the origin while points moving towards the viewer move away from it.
To get a truly "inside out" effect, vertices moving away from the origin have to move right past vertices moving towards the origin. This is tricky because vertices may have substantially different distances from the origin for other reasons, e.g. because they sit at different distances in 4-space. It's easier to get this visual effect when we have a decent number of vertices that are a similar distance from the origin in 4-space but very different distances from the viewing plane.
Status quo.
The animations in the notebook are generated by applying a transformation
or, in mathematical notation,$v_o = \pi( B^T\cdot R(-\theta)\cdot A^T\cdot v_i)$ . Here $R(\theta)$ is rotation by $\theta$ in the first two coordinates (i.e. around the axis $\langle e_3, e_4\rangle$ ) and $\theta$ is a parameter that we slide along the range $[0,2\pi)$ in order to generate the animation frames.
Currently,$A$ and $B$ are generated randomly. Clearly, random rotations do not generate the images we want.
Solution.
Try to figure out ways to generate "interesting" rotations.
Examples: