
            Magic Cube 4D
            Copyright 1994, 1996, 1997, 1998, 1999, 2000
            by Daniel Green, Don Hatch and E. Jay Berkenbilt

 
MagicCube4D is a four-dimensional Rubik's cube (generically called a "magic
cube"). It is an exact analogy in four dimensions to the original plastic
three dimensional puzzle, but with some useful features - such as a "reset"
button - which the original puzzle lacked.

Q: How can it really be a four dimensional object when there are no such
things as 4D objects?
A: It's true that there are only three spatial dimensions in this universe,
but mathematically speaking, there is no problem at all extrapolating into
an arbitrary number of dimensions.  Computers are perfectly happy to model
objects in higher dimensions.

Q: Even if the computer can deal with 4D objects, how can it display one on
on a 2D screen?
A: Using the exact same mathematical techniques that are used to project 3D
objects onto 2D screens, we "project" 4D objects into 3D. The resulting 3D
objects can then be rendered with conventional graphics software onto the
screen.

Q: If you're projecting from 4D down to 2D, isn't it impossible to
understand what you're seeing?
A: The 3D objects can easily be understood by rotating them around on the
screen. You can do that by clicking the left button of the mouse in the
window and dragging the mouse around with the button held down.
It is probably impossible for a human to ever truly understand 4D objects
by examining their 3D "projections" with the same clarity that even a
child easily understands the 3D nature of objects rendered on a computer
screen.  Even so, it is quite possible to gain a strong feeling for the 3D
projections that result from some operations on 4D objects.

Q: So what does it mean to make a 4D magic cube?
A: Every feature of the original puzzle has an analogy in four dimensions.
For the rest of this document, those features will be in double quotes when
we are talking about higher dimensional analogies.
The little 2D colored stickers of the original puzzle are replaced by 3D
little 3D colored boxes. The original 2D stickers on the face of a solved
cube were arranged in a 3x3 square array. In the 4D version, the 3D
"stickers" are arranged in 3x3x3 cubic "faces". Both puzzles are solved
when all sticker on the same face are the same color, and both puzzles
start in their solved states.

Q: When running MagicCube4D, only one of the "faces" is really a cube. Why
are the other "faces" distorted?
A: The distortion is due to the perspective projection of the 4D "faces"
into 3D. They are distorted for the same reason that the square faces of
a 3D cube are distorted when projecting them onto a 2D screen or photograph.
In a photograph of a 3D cube, only one of its faces can be truly square
on the image. That is why only one of the eight "faces" of the 4D Magic Cube
cube is truly cubic.

Q: If there are eight "faces" in a 4D magic cube, then why do I see only
seven when I run MagicCube4D?
A: Notice that you can never see all six faces of a 3D cube at the same time.
The display in MagicCube4D is similar but different.  The missing eighth "face" 
is really the one closest to the viewer in 4D, but the distortion of its
projection into 3D turns it completely inside out. It could still be drawn,
but it would overlap most of the other geometry. The view that MagicCube4D
gives you is more analogous to looking into a box with the lid taken off.
The cubic "face" in the center is the smallest because it's really the one
furthest from the viewer, and is therefore analogous to the bottom of an
open 3D box.

Q: I can turn a real cube around so that I can see the hidden faces, can
I do something similar to see the invisible eighth "face"?
A: Yes. If you hold down the control key and click either mouse button
on any part of a "face", the puzzle will "rotate" in 4D until that "face"
is in the center.  That "rotation" will bring the invisible face into the
same position as the one you clicked on. The "face" on the opposite side
of the puzzle will "rotate" out until it turns inside-out and becomes the
invisible "face".  This "turning inside-out" motion is very typical of 4D
"rotations".  Notice that control-clicking either mouse button on the
central "face" does nothing because it's already in the center.

It's important to notice that rotations never affect the state of the
puzzle, they just let you look at the same puzzle from different angles.
So "rotating" a solved puzzle (in 3D or 4D) will always leave it in its
solved position. Only twists will affect the state of the puzzles.

Q: So what does it mean to "twist" on a 4D magic cube?
A: People generally think of twists in 3D as turning something about an
axis. It's just a quirk of three dimensions that that makes any sense,
and is no help in the general case. It's better to think about a ninety
degree twist as follows: take the face you want to twist and remove it
from the larger object. Turn it around any way you like without flipping
it over, and then put it back so that it fits exactly like it did before.
On a 3D magic cube, there are therefore only four possible ways to put
the face back on. With a "face" of a 4D cube, it's like taking a cube out
of a box, turning it any which way (but not turning it inside-out), and
putting it back in its box. There are 24 different ways to do this.

Q: How do you perform a "twist" on a "face" in your program?
A: Notice that each 3x3x3 "face" can be thought of as 26 little "stickers"
surrounding a 27th one. If you click on any of those outer "stickers",
that whole face spins about the axis that goes through the center of
that "sticker" and the central one. It spins until it's back in the same
orientation that it started in. So if you click on a sticker which is
in the center of one of that "face's" 2D face, it will take four twists
before it is back where it started. Likewise, if you click on one of
the corner "stickers", it will only take three 120 degree twists before it
comes all the way around, and if you click on an edge "sticker", it will
only take two 180 degree twists. Using the left mouse button twists
counter-clockwise, and the right button twists clockwise.

Q: OK, so clicking a "sticker" on a "face" twists that face into a new
position without changing it, but why do some 3x3 slices of other faces
spin or fly onto other faces?
A: That is the scrambling (or unscrambling) effect of twisting a "face"
on a 4D magic cube. Notice that a twist on the original magic cube
doesn't change the state of the stickers on that face, but it does
affect the state of adjacent faces. Notice also that the "faces" and
"stickers" of the puzzle are separated from each other by gaps. In a
real 4D magic cube (if that makes any sense), all the "faces" and
"stickers" would be slammed together. The view we present is simply
an exploded version of the real 4D puzzle so that you can see the
internal state. It is a good idea to imagine how they would slam together,
because adjacent "stickers" on adjacent "faces" are permanently stuck
together just like pairs and triplets of stickers on the original 3D
magic cube are permanently stuck together on the outer 27 plastic
parts.

Q: Why do the resulting twist animations look so different when performed
on one "face" as opposed to another?
A: This is due again to the perspective distortion of the 4D object into
3D. It's best to practice twisting only on the central "face" for a while
because none of the twists on that face cause any distortions.  Once you
know exactly what each click will do on the central "face", try the
following exercise:
   1: Perform a single twist on the center "face" of a reset puzzle.
      (Select the "Reset" item under the "Options" menu first if needed.)
   2: "Rotate" that "face" so that it's no longer the central "face".
      (control-click on one of the non-central "faces".)
   3: Try to untwist the twisted face with a single mouse click.
The right "sticker" to click on will be the same one that you clicked on
before, but now it's in a new position. You will also need to click
with the other mouse button to make it twist in the opposite direction.
Watch how it animates back into place. After trying this a few times
you get a good sense of what is happening. It's also good at first to
only try the 90 degree twists (i.e. clicking only on "sticker" at the
centers of the 2D faces). Another useful exercise is to first perform
a twist on one of the non-central "faces" of a reset puzzle, then
"rotate" that "face" into the center (control-click it), and finally
try to twist it back into the solved state from there.

Q: Sometimes it twists in ways that I didn't want. What am I doing wrong?
A: Because there are so many "stickers" packed close together, it is easy to
be a little bit off and to accidentally click a different one behind the one
you expected.  it is very important to have the tip of the mouse pointer
be exactly on top of the "sticker" you are trying to hit. It may help to
click the "maximize" button on the window so that it expands to full-screen.
If that doesn't help, then go back to practicing only on the central "face".
You can always undo a move by hitting control-Z, or via the Undo or
Take-Back menu options, or simply by "twisting" on the same "sticker" in
the opposite direction.

Q: How do I solve the puzzle?
A: You first need to scramble it up, and then perform twists until all
"stickers" of each "face" are the same color. To truly solve the puzzle,
you must first select the "Full" item under the "Scramble" menu. The first
time you try that, it will be a shocking mess. It's a truly difficult
job to solve it from a full scramble. If you ever do succeed, you will
be one of a *very* elite group of people. You will almost certainly need
to have previously mastered the original magic cube before you can hope
to solve this one. Luckily, all of the skills you learned for the original
puzzle will help you with this one.

Q: If it's so hard to solve, then why should I even bother with it?
A: You don't need to ever solve the full puzzle to enjoy it. One fun game
is to choose less than the full scramble and try to twist it back to the
solved state. First master solving it starting from one random twist. Then
work up to two, three, and more. Each higher level that you actually solve
even once makes your skills much more impressive. Another fun thing is
to fully scramble the puzzle, and then use the Options/Solve menu item
and then watch as the puzzle solves itself. Finally, it's a nice thing
to simply have some experience manipulating a four dimensional object.

We hope you enjoy MagicCube4D. If you ever do solve the full
puzzle, then please save and send us your MagicCube4D.log file. Also, feel
free to send us any comments or suggestions you might have about the
program.

Finally, please feel free to share this puzzle with anyone you like
for their personal use. For all commercial purposes including using the
program as free demos to help promote a company, product, or service,
you must license it from us first.

Daniel Green      (dgreen@superliminal.com)
Don Hatch         (hatch@sgi.com)
E. Jay Berkenbilt (ejb@ql.org)
