4D Building Blocks - an interactive game to explore 4D space

Discuss interdimensional programming, Java applets and so forth.

4D Building Blocks - an interactive game to explore 4D space

Postby bo198214 » Wed Dec 07, 2005 1:52 am

Hello folks,

some years ago I also wrote such a 4D Polytope viewer,
like many of them can be found in the web today (even with
hidden surface removal).

But with time it became a bit boring looking at those only convex
and regular shapes, as beautiful they may need to be in general.
So the idea of 4D Building Blocks was born.

Originally I had in mind to extend this 3D-Tetris Block-Out
(which may some of you still know) to 4D, but thought that
most players (especially me) will be overstrained by the time pressure.

So it became Building Blocks, where you have to put together
different given shapes to a given final shape, each compound of
unit tesseracts.

A protoypical implementation is now finished and can be found on my homepage.
It needs some more fancy levels (perhaps you can provide me your wishes/ideas).
At the moment there are 4 rather simple levels available.

I am thinking of 4D covered area removal, which is mainly that 4D-near
Objects overpaint 4D-far objects in the 3D-Projection. But it seems
very time consuming both in developing and execution
(its written in Java!).

So i am interested in your feedback and wish
you fun playing with building blocks like a child :wink:

Henryk Trappmann
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Postby pat » Wed Dec 07, 2005 9:08 am

I wish I could try this... but I'm having browser compatibility issues.

If possible, if you can rebuild it with the flags
Code: Select all
-source 1.2 -target 1.2
, that will probably fix it. It will also make it much more generally accessible to folk.

I had started something like this back many moons. But, I never completed it. I was going to make 2, 3, 4, and 5 dimensional versions. Alas, I spent too much time working on XML-parsing for level files and not enough time on actually implementing the game. I was going to use a slices view rather than a wireframe one....
pat
Tetronian
 
Posts: 563
Joined: Tue Dec 02, 2003 5:30 pm
Location: Minneapolis, MN

Postby bo198214 » Wed Dec 07, 2005 1:33 pm

Regarding your browser problem: You can also download the .jar
and start it locally (see the download link on my page.),
so browser doesnt need to be involved.
Though you still need to install the JRE 5.0.

Unfortunately it isnt 1.2 source, I started with that (for exactly that
accessibilty reasons) but changed later to 1.5 because it is much more
comfort programming with typed collections and the IE initially anyway
supports only 1.1, so one have to upgrade jre, so why not then
immediately to 1.5.

And by the way, for me it was also a long and stony way to start and
continue this project....

Best regards,
Henryk
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

New version with 4D isometric and cavalier projection!

Postby bo198214 » Sat Dec 17, 2005 1:50 am

I am happy. Have a new version of 4D Building Blocks available.
And it looks so pretty! New levels also available.

For example the 4 parts in the following pictures can be reassembled to
a 2x2x2x2 cube. The following pictures are screenshots of the game display.

With cavalier/isometric projection and one version for parallel eyes and one for those
proud owners of red/cyan glasses (for which by
the way there are numerous nice pictures in the web).

Cavalier, parallel eyes:
Image
Cavalier, red/cyan:
Image
Isometric, parallel eyes:
Image
Isometric, red/cyan:
Image

Greetings to all you 4D enthusiasts,
Henryk
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Postby Muzozavr » Tue Dec 20, 2005 9:51 am

I tried your game, but there's too many popups and they are popupping even with my pop-up blocker. My computer is too slow and the mgame is almost hanging. :(
Seems very interesting. I started to learn controls and just playing with shape of blocks and the game hang. :evil:
I had very much fun, though.
I don't live in four dimensions... at least not yet...
Muzozavr
Dionian
 
Posts: 16
Joined: Mon Dec 19, 2005 9:59 am

Postby bo198214 » Tue Dec 20, 2005 11:06 am

hm, actually it has no popup windows at all.
In IE the Java-Plugin is regarded as an active-X control. When I start it locally (!) with the IE, then it refuses, saying something security, block, bla.

Sometimes I also experienced a hang when adjusting the brightness. But because it was so seldom, thought it had no relevance (have a relatively fast computer ...). Am looking to fix it, have already idea of the reason...
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Postby Muzozavr » Wed Dec 21, 2005 6:41 pm

No popups, you say?? :? You are a happy person. For me it comes like that:

i playing the game for a half-minute
two or more popups (ads) are coming out.
i closing them.
i playing the game for half-minute.
popups are popping out and starting to make my computer really slow.
this repeating five-six times...
game hang...
RESET...
I don't live in four dimensions... at least not yet...
Muzozavr
Dionian
 
Posts: 16
Joined: Mon Dec 19, 2005 9:59 am

Postby bo198214 » Wed Dec 21, 2005 6:45 pm

God beware!
Neither on my page nor in the game are popups or ads.
Are you sure havent catched some neat "browser helpers", or toolbars, spyware, adware or etc?!!!
No wonder that your computer is that slow.
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Wow

Postby quickfur » Thu Jan 05, 2006 7:14 pm

Wow, this is awesome!! I've been wanting to write such a game for a while now, in order to learn how 4D things fit together. You beat me to it. :-) This is very, very cool.
quickfur
Pentonian
 
Posts: 2482
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

Postby moonlord » Tue Jan 17, 2006 5:29 pm

why not implement a 3d version? it's quite difficult for me to visualize 4d so i'd like to 'take it easy'. i don't think it would be too difficult...
moonlord
Tetronian
 
Posts: 605
Joined: Fri Dec 02, 2005 7:01 pm
Location: CT, RO, CE EU

Postby bo198214 » Wed Jan 18, 2006 10:45 pm

@moonlord
Hey this is a 4D forum! *nudge*
If you are after 3D experiences, maybe you should try CAD.
As I already wrote, I was influenced by the 3d-tetris block out, maybe you want to try this.

@quickfur
Nice, if you like it :)
May I ask you for some feedback:
What viewing mode did you use (parallel,crossed,red/cyan)?
How difficult did you find the levels? Did you solve all? (nearly cant them solve by myself ... :wink: )
Any other comments?
By the way, I really like your 4D visualization page, its mostly as I would had done it :wink:
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Postby quickfur » Wed Jan 18, 2006 11:27 pm

bo198214 wrote:@quickfur
Nice, if you like it :)
May I ask you for some feedback:
What viewing mode did you use (parallel,crossed,red/cyan)?
How difficult did you find the levels? Did you solve all? (nearly cant them solve by myself ... :wink: )
Any other comments?

Actually, my comment was just based on your screenshots and descriptions. :oops: For some reason, it doesn't work on my computer. Only the menu bar shows up at the top; the rest of the screen is either completely black or white (none of the screens show up... they either appear as total black or white). I'm not sure if this is a problem with your program, or I just have a bad installation of Java. I haven't taken the time to figure out what the problem is since.

By the way, I really like your 4D visualization page, its mostly as I would had done it :wink:

Thanks! Any comments on my pages? :wink: I'm kinda stuck on what the next chapter should cover... any suggestions?
quickfur
Pentonian
 
Posts: 2482
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

Postby bo198214 » Wed Jan 18, 2006 11:59 pm

For some reason, it doesn't work on my computer.


Thats really a pitty :( Can you send me, java -version, operating system, stack trace?! I only say "write once run everywhere" ....
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Postby quickfur » Thu Jan 19, 2006 1:05 am

bo198214 wrote:
For some reason, it doesn't work on my computer.


Thats really a pitty :( Can you send me, java -version, operating system, stack trace?!

Output of java -version:
Code: Select all
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode, sharing)


Operating system is GNU/Linux (Debian/unstable), although what is probably more relevant is the fact that I'm using the X.org X server (not the more popular XFree86). I don't think this should be an issue, but you never know.

I only say "write once run everywhere" ....

Hehe... some people change that to "write once debug everywhere" :-)
quickfur
Pentonian
 
Posts: 2482
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

it works!

Postby quickfur » Mon Jan 23, 2006 6:24 pm

I just wanted to say, I just tested the new beta version, and it finally works on my computer!!

It's a lot of fun, I managed to solve goal #1 and goal #3. I almost got goal #4, but orienting the pieces is SO tricky. The only complaint I have is that moving the camera(s) around is rather unintuitive. I still haven't figured out what exactly those camera controls do. Oh yes, if there is a way to increase the separation between the two images in parallel mode, I'd be happy to know what it is. Right now I'm playing in flat mode, and it's rather hard to see what's going on. :-)

Update: OK, I finally learned how the camera controls work. It's actually pretty good, except that I was distracted by the polar coordinates buttons, which have nothing to do with it. :oops: Anyways, I solved scenarios #0, #1, #2, and #3. :-) #4 is really hard, I still haven't figured out how to orient the two pieces correctly relative to each other. #5 looks really scary... :shock: I haven't dared try it yet.
quickfur
Pentonian
 
Posts: 2482
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

Postby Muzozavr » Wed Jan 25, 2006 4:13 pm

I have a few "catched" popups but NO page gave me SOOOO many of them! How strange...
I checked your HTML source codes, and yeah, there is no popups. But why on this page the "browser helpers" becoming so active?
I don't live in four dimensions... at least not yet...
Muzozavr
Dionian
 
Posts: 16
Joined: Mon Dec 19, 2005 9:59 am

Postby bo198214 » Thu Jan 26, 2006 4:15 pm

I never wrote a browser helper :wink:
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Postby quickfur » Fri Jan 27, 2006 1:17 am

bo198214 wrote:I never wrote a browser helper :wink:

< obligatory flame-bait >
Why don't people just install a useful, non-b0rken browser, like Firefox or Opera, instead of that disaster known as Internet Exploder? You'll never need to worry about popups, viruses, and other junk again. Do yourself a favor already!
< / obligatory flame-bait >
:P

And I should add, I played with 4DBB several times already, and never did run into popups or anything of that sort. I think people having trouble with that are infected with a virus or something, and should do a virus scan soon.
quickfur
Pentonian
 
Posts: 2482
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

Postby moonlord » Fri Jan 27, 2006 4:07 pm

After reading quickfur's intro to 4D and killed some more neurons, I finally start to 'see' something. I just realised one could do some 4D geometry problems. I might try some. They might just prove to be interesting...

As to 4DBB, I still have a hard time navigating, but managed to do all puzzles except last one, which, as quickfur already said, looks horribly difficult. BTW, it might help if you renamed the labels of rotations with the names of the planes in which the rotation will take place. Same for the camera rotations.

Anyway, great job, bo. Keep going! If I may, I'd like to see the sources to the projection method, please :) It looks good...

PS: I use Opera. Used it for 3 or 4 years and seems difficult to switch to Firefox, for example. Same opinion on IE :D.
moonlord
Tetronian
 
Posts: 605
Joined: Fri Dec 02, 2005 7:01 pm
Location: CT, RO, CE EU

Postby bo198214 » Fri Jan 27, 2006 5:00 pm

moonlord wrote:After reading quickfur's intro to 4D and killed some more neurons ...

Yeah, its a good basis, and am happy that I can refer to it instead of writing it myself.

I still have a hard time navigating,

Can you be a bit more specific?
Can you anyway tell me, what viewing mode you used?!

but managed to do all puzzles except last one

congratulations!
To solve the last, I can happily cheat, by looking into my code ;) :P *ggg*

it might help if you renamed the labels of rotations with the names of the planes in which the rotation will take place.

*wonder* They ARE labeled with the planes ... for example 2-4 means the plane spanned by v1 and v4. Even the rotation direction is indicated by that, 2-4: rotating v2 towards v4.

If I may, I'd like to see the sources to the projection method, please :)

You can have a look at it, but its then only for your private nonpublic use.
Though I anyway think that understanding my code is more difficult than derive them by yourself.

PS: I use Opera. Used it for 3 or 4 years

me too

PS: If you have some ideas/suggestions for 4d-puzzles dont be shy, I can include it then in the game.
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Postby quickfur » Fri Jan 27, 2006 6:30 pm

moonlord wrote:After reading quickfur's intro to 4D and killed some more neurons, I finally start to 'see' something. I just realised one could do some 4D geometry problems. I might try some. They might just prove to be interesting...

Good to know that what I wrote is actually helpful. I did spend a lot of time and effort on it. Unfortunately, in a few weeks' time, I'll be back to a super-busy schedule and would have no time to work on it... but eventually I hope to move the diagrams to povray, so that we can get rid of the stupid ambiguous XFig wire-diagrams.

As to 4DBB, I still have a hard time navigating, but managed to do all puzzles except last one, which, as quickfur already said, looks horribly difficult.

Congrats! I couldn't even solve the second-to-last one. I guess I just haven't tried hard enough. :P

Are there any new levels coming? :D

[...]PS: I use Opera. Used it for 3 or 4 years and seems difficult to switch to Firefox, for example. Same opinion on IE :D.

Actually, I'm a big Opera user too. I started using it around 3 or 4 years ago as well, back in the days of Opera 5. I was actually impressed enough with it that i actually paid for registration(!). It must be the first time in my life I voluntarily paid for software. :P

Firefox is nice, but I find it too dumbed-down for my liking. Opera is a good balance between usability and power. The only complaint is that occasionally you run into websites with IE-only b0rken javascript which doesn't work in Opera. It's not Opera's fault for sticking with the ECMA standards, but still, it's annoying.
quickfur
Pentonian
 
Posts: 2482
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

Postby moonlord » Fri Jan 27, 2006 7:07 pm

>bo198214: I used crossed-eye izometric, and I expect my red/cyan glasses to arrive soon. Regarding the rotations, I find using X, Z, Y and W much more intuitive than v1 and so. The planes of rotation would be, for example, XZ, WZ, YW... you got the point.

>quickfur: The pics in your pages aren't stupid, but quite ambiguous. I can however say that I understood most of them. I was thinking of creating rotating, stereo animations of them. It's a dumb idea overall... four pics that size will make pages 5 MB or so, not to take into account that they pause the lecture, and can drive the reader to 'lose the thread'. I will give it a try though. I want to have my own intro to 4D :D.

Levels, huh? I'll think about it... :D

PS: Sorry about this english, but it's not native and sometimes I cannot find my words.
moonlord
Tetronian
 
Posts: 605
Joined: Fri Dec 02, 2005 7:01 pm
Location: CT, RO, CE EU

Postby bo198214 » Fri Jan 27, 2006 11:44 pm

moonlord wrote:Regarding the rotations, I find using X, Z, Y and W much more intuitive than v1 and so.

Hmm, of course x,y,z is common for 3 dimensions. What slightly disturbs me, is that w comes before x and so I would assume, its the first dimension. In physics you usually use x as position vector x<sub>1</sub>, x<sub>2</sub>, x<sub>3</sub>. Ok, but x,y,z,w might be the most intuitive for 4d, Ill adapt it next revision (for 5d you then use x,y,z,w,v ?)

I was thinking of creating rotating, stereo animations of them.

I already told him to use stereo techniques ;) The problem is only, always to have mono, crossed, parallel and red/cyan might be a bit cumbersome (to create, maintain, and read).

Sorry about this english, but it's not native and sometimes I cannot find my words.

Isnt my native language either. Didnt notice any difficulties with your english.
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Postby thigle » Sat Jan 28, 2006 1:11 am

wow this game is GREAT ! unlike my abilities: i just made it through 2nd puzzle, will have to go to take some sleep now.

anyway, I, on the contrary, find your notation more intuituve than XYZW notation. ESPECIALLY with planes being noted by numbers (2-4 for v2 & v4, ...), it is much more easier (for me) than xw, yw, zw or whathaveyou.

so, to please the broadest range of potential players, maybe you should keep the current one, and implement the letter notation as well.
then you might want to include a toggle for switching these. (and then another toggle that toggles the toggles: a meta-toggle ! is this a neologism :idea: : :?: if so, I claim intellectual improperty ! a copynight. )

just my2pence. :wink:
thigle
Tetronian
 
Posts: 388
Joined: Fri Jul 29, 2005 5:00 pm

Postby bo198214 » Thu Feb 22, 2007 10:31 am

Oh did I already tell that there is a new version of 4DBB out there?!

In Version 0.9.1 there are
  • sound
  • two new simple levels,
  • and the levels advance, as one would expect in a game
  • axes are now named xyzw (sorry thigle)

Enjoy!

What I though really struggle with in the moment is 4d occlusion culling, damn is this complicated matter, at least practically. So probably you have to wait for the next version to see the world premiere of 4d occlusion culling (note that back face culling is a rather simple matter).
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Postby quickfur » Thu Feb 22, 2007 4:23 pm

bo198214 wrote:Oh did I already tell that there is a new version of 4DBB out there?!

In Version 0.9.1 there are
  • sound
  • two new simple levels,
  • and the levels advance, as one would expect in a game
  • axes are now named xyzw (sorry thigle)
Enjoy!

Cool! I'll have to give it a try sometime. Maybe sometime next week, as I'm moving this weekend and just started a new job.

What I though really struggle with in the moment is 4d occlusion culling, damn is this complicated matter, at least practically. So probably you have to wait for the next version to see the world premiere of 4d occlusion culling (note that back face culling is a rather simple matter).

4D occlusion culling is equivalent to 3D CSG difference, just as 3D occlusion culling is equivalent to 2D CSG difference. So at least in theory it's straightforward, but of course, actually implementing this (and implementing it in a usable manner) is another story.

(CSG = constructive solid geometry. 4D occlusion culling is essentially subtracting the 3D projection images from each other according to their distance in the 4th direction.)
quickfur
Pentonian
 
Posts: 2482
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

Postby bo198214 » Thu Feb 22, 2007 5:56 pm

quickfur wrote:4D occlusion culling is equivalent to 3D CSG difference, just as 3D occlusion culling is equivalent to 2D CSG difference. So at least in theory it's straightforward, but of course, actually implementing this (and implementing it in a usable manner) is another story.

(CSG = constructive solid geometry. 4D occlusion culling is essentially subtracting the 3D projection images from each other according to their distance in the 4th direction.)


Yes exactly, you sort the tesseracts (which are the atoms in 4DBB) by distance from the 4d viewer. Projecting them you get distorted cubes in 3d as the facets of the tesseracts. Then you simply paint them in the order of distance on the 3d canvas, in overpainting mode.

If the cuboids were represented as a set of voxels, you would simply overpaint by replacing the previous voxels. But if a cells is given by the set of its subcells/facets and painted by drawing its 2d cells, i.e. the edges, then there is quite a bit thinking necessary. But maybe we can discuss this in another programming thread (I mean it is probably not more difficult then computing the convex hull of a point set, but I want occlusion culling in general n dimensions so trying to make life as difficult as possible ;) The base of my algorithm is cutting an n-cell by a plane, you started already the corresponding thread.)
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Postby quickfur » Fri Feb 23, 2007 5:28 am

bo198214 wrote:
quickfur wrote:4D occlusion culling is equivalent to 3D CSG difference, just as 3D occlusion culling is equivalent to 2D CSG difference. So at least in theory it's straightforward, but of course, actually implementing this (and implementing it in a usable manner) is another story.

(CSG = constructive solid geometry. 4D occlusion culling is essentially subtracting the 3D projection images from each other according to their distance in the 4th direction.)


Yes exactly, you sort the tesseracts (which are the atoms in 4DBB) by distance from the 4d viewer. Projecting them you get distorted cubes in 3d as the facets of the tesseracts. Then you simply paint them in the order of distance on the 3d canvas, in overpainting mode.

We don't want to use voxels, 'cos we need to deal with the mathematical structure of the polytope. Instead, we want to do something like what is described here: http://www.flowerfire.com/ADSODA/
This is a general n-dimensional algorithm, although it does assume parallel projection. For perspective projection, things are a little more tricky.
quickfur
Pentonian
 
Posts: 2482
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

Postby bo198214 » Fri Feb 23, 2007 10:31 pm

A bit progress could I despite make, have a look at two tesseracts with the marked one nearer to the observer:
Image
Image
Image
Image
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

mac users?

Postby bo198214 » Fri Mar 09, 2007 1:52 pm

Hello mac users (especially pat and d.m.falk)!

I would be interested whether this game works on mac. I once tried it on the mac of a friend with safari, but somehow the graphics looked awkward (lines somehow uncontinuous). But I dont know whether this was due to a misconfiguration of java with safari on that particular notebook or whether it generally doesnt work peroperly on mac.

So any experiences?

http://math.eretrandre.org/4dbb/
bo198214
Tetronian
 
Posts: 690
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Next

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest