This program is a development of one I had on the BBC micro years
ago. This one uses the mouse to move the hypercube rather than
keyboard keys and has on-screen instructions.
I should really write something better about it, what follows is from the BBC micro version but converted to html. The text and graphics were originally in Viewdata format.
The BBC micro version was written in about 1985 in 6502 assembler. Much sweat and tears resulted in a speed of about five frames a second. The Acorn Archimedes version which introduced the mouse control was written in C in 1991.
A screen dump from the Archimedes version
The demon continuously stares at a 4 dimensional cube, a hypercube or tesseract, with a hypersphere at each corner.
The image on the back of a demons eye is three dimensional, as opposed to the image on the back of our eyes which is two dimensional. It is this three dimensional image that is shown.
Before launching into the fourth dimension it is worth considering what happens when we look at an ordinary cube with a sphere round each corner.
The image is two dimensional. The nearest point corresponds to the biggest circle which is near to the centre of a ring of smaller circles. A Flatlander, a two dimensional being, could use the picture and the size of the circles to clue himself/herself/itself about 'depth'.
Various views of a cube appear on the next page.
Flatlander says move up. The central sphere moves down.
If a flatlander controlled us then he could direct us according to the two dimensional image at the back of our eyes, after all that is what we do.
He can say move in the Y direction meaning up, or in the X direction meaning right, or inward which makes the image larger.
It is more convenient (and easier), if instead of the X and Y direction meaning go straight up or down they mean move on the surface of a sphere around the cube keeping a constant distance from it, this is the natural movement if we are always gazing straight at the cube.
We control the demon in a very similar way to how a Flatlander would control us. The demon looks fixedly at a 4-D Cube, a tesseract, with a hypersphere, a 4-dimensional sphere, round each corner.
When the associated program is run the initial view is as looking directly at one corner. The big sphere at the centre is the one nearest to us in 4`D. The are four squashed cubes around the central sphere. For a 3`D cube the central large circle is surrounded by three squashed squares when viewed from a corner.
Pressing various keys causes the demon to move in the X, Y, or Z direction on a hypersphere round the tesseract, or to move in or out. There is also the option to rotate the view or enlarge or reduce the image.
Moving the mouse with a button pressed causes the daemon to move on the sphere round the tesseract, or to move in or out as described in 'Program Control' below.
The tesseract has 16 corners, 32 edges 24 plane faces, and 8 cubes. Only 4 cubes are visible in the initial view as the other 4 are on the 'other' side, there is hidden volume elimination!. There is an option to give a 'wire frame' view where all the corners are visible.
The four dimensions of this program are Euclidean dimensions, nothing like Special Relativity which can have two points separated by zero distance.
Command are given to the demon using the number keys 1 to 9 and 0, and the SHIFT and CTRL keys. Two number keys may be pressed at a time to give a combined effect.
The CTRL key when pressed makes any movement take place in bigger steps so the display is changed faster.
The SHIFT key when pressed has the effect of making a 3`D type movement of the image rather than a 4`D movement. 3`D rotations are 4`D rotations about the line of sight.
Other options allow the colour scheme to be changed, and to switch between a wire frame view or the solid view.
|No Shift.||4`D Movement|
|1||Move out away, greater depth.|
|2||Move in closer|
|3||Move in X direction|
|4||Move in -ve X direction|
|5||Move in Y direction|
|6||Move in -ve Y direction|
|7||Move in Z direction|
|8||Move in -ve Z direction|
|1||Make image smaller|
|2||Make image larger|
|3||Rotate about X axis|
|4||Rotate -ve about X axis|
|5||Rotate about Y axis|
|6||Rotate -ve about Y axis|
|7||Rotate about Z axis|
|8||Rotate -ve about Z axis|
|0||Show wire frame view|
|SHIFT 0||Show view with hidden volume elimination.|
|9||Change colour scheme. This is followed by four numbers in the range 0..7. These give the actual colour of the background, the two colours mixed (with a little of the background colour) in the hyperspheres, and the edge colour.|
To stop the program press BREAK,
Could you write a program that drew an accurate picture of a solid cube with a sphere at each corner. You will then see why my representation of a tesseract is not accurate!
How many legs would a hypercat have? Can knots be put into sheets in the fourth dimension?
What is shading like in 4D? I think of it as a haze or a density of transparent colour.
Dover Books have a number of softbacks about the fourth dimension including a reprint of the original Edwin Abbott book on Flatland.
The following Pelican books have sections on the subject: