Dusted off – 4D games

Hopefully I’m not infringing any trademarks with the term 4D games, but many years ago I was fascinated with the idea of why the human brain (except Stephen Hawking’s) cannot think in more than three dimensions.

I’d seen a number of books and even short videos of 4D visualisations, but you never quite understand something until you can fight it or play with it and control it. So I thought why not make a simple 4D game and see if it causes a mental phase-change if it “clicks”.

I wanted to start with a simple game: put a peg in a hole. Sounds easy, but I’m presuming in 4D it’ll get weird really quickly. Then later on we could move on to more complicated puzzles, like jigsaws, knots, shooting/aiming, driving. The list is as endless as for 3D, but we need to take baby steps into this confusing world.

My first venture in the 90’s was into C++ libraries, researching rendering, ray-tracing, collision detection and so-forth. I even discussed it with some experts in the field who thought I was mad to try collision detection in 4D. I did try to amend a port of a 3D graphics library – how hard could it be to add one more dimension? But my grasp of complex maths proved far to tenuous.

Later I discovered a nice Flash visualisation of a hypercube with source* so I managed to modify it to make a more interactive version.

(* I’m sorry to say since 2006 I’ve lost the attribution for the source, if you recognise it please let me know!)

I added more controls to be able to control every aspect of the view – including the W dimension (which is probably the wrong name for it). The curious thing is that adding the extra dimension leads to the need for two new controls (like pitch, roll and yaw) which I’ve labelled XW and YW. I don’t really understand them, as they were reversed engineered from the mathematics but seemed to be needed to complete the control of all variables. If anyone can explain it I’d be very interested.

The graphics are terrible, the UI is incomplete! It’s just dusted off.

The keyboard controls are:
A-Z: Rotate X-axis  |  S-X: Rotate Y-Axis  |  D-C: Rotate Z-Axis
V-B: Rotate around XW Axis  |  N-J: Rotate around YW Axis (I think!)

Click the Autopilot and set the periods to have make a trippy screensaver.

View the SWF here

Download Source zip

 

This entry was posted in Dusted Off, Projects and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.