Message #9

From: David Vanderschel <>
Subject: Fwd: Re: [MC4D] Re: phew, at last… [4^4 solution]
Date: Fri, 01 Aug 2003 19:33:39 -0000

Date: Mon Apr 8, 2002 10:41 pm

— In, Jay Berkenbilt <ejb@q…> wrote:

> > […] (The windows version uses a 3d
> > library, eliminating the need for the code to do the 3d -> 2d
> > I’d think a java port would do the same, especially with
java3d.) I’m
> > sure Don or Daniel can correct me if I’ve misrepresented
> > here.
> well, while i did use the Direct3D library from microsoft, i don’t
> think i’d use java3d in a java port. that’s rather sad because
> this would be the natural thing to do except for the fact that it
> wouldn’t be able to run in a browser without the users installing
> plugins, which is too much to ask.
> happily, the other way of using don’s 3d->2d code would map very
> nicely to the polygon capabilities of the java.awt.Graphics class
> and is plenty fast on most machines.

Now I’m probably really venturing into territory I’m not that familiar
with since it’s been a while, but if I recall from when I originally
started looking at the code, the polygon code has some issues
involving the order in which things are drawn. Although it appears to
always work correctly under ordinary circumstances, is it possible
that it may not in some cases, such as if the shape were not a
hypercube? Put differently, I have a vague memory of looking through
the code and thinking that it wasn’t implementing a general projection
of 4D into 2D but something that took advantage of some additional
information. I could be way of base here. There are also some issues
with odd effects with some of the rotations on the versions of the
puzzle that have more pieces per side, but I believe this is just a
case of the stickers bumping into the "glass". Moving the w-axis eye
further "back" seems to alleviate the problem. Regardless, that
polygon code and the other aspects of the internals of mapping the
puzzle into the graphical manifestation (okay, and Don’s perl script
that solves the puzzle) is probably the most brilliant code I’ve ever
seen. When I started playing with this puzzle in 1998, I was pretty
amazed at how well it performed on my hardware at the time (a 133 MHz
pre-MMX Pentium) and was astonished to learn that the code was as old
as it was. Of course, Java code can perform very well too – you just
have to be a little more careful with it. :-)

I would concur with the decision to avoid Java3D for now. The plugin
reason is one, and the relatively sparse support for Java3D on
multiple platforms is another. No doubt these problems will both go
away before too long.

                            Jay<br> --- End forwarded message ---