OZONE Asylum
Forums
Server-Side Scripting - Oh my!
More than N Dimensions
This page's ID:
33118
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
This is just the basic algorithm for a directed graph mapping system. I do have this coded in Python. I've also cobbled together some quick-n-dirty PyGame for graphics, but very in-efficient cobbling. Basically, I learned just enough PyGame to get the graphics working. We start with two planes that are connected at two corners and we index them. Notice that the indexing starts at 1 and not 0. There is a reason for the oddball indexing that should become apparent as we move along. Two indexed planes and they are connected at two points. [code] + - - - - - + - - - - - + | | | | | | | 1 | 2 | | | | | | | + - - - - - + - - - - - + [/code] Now we index the corners and seperate them. The indexing for the corners is arbitrary and can start at 0 if you want. I just started with 1 just because. [code] 1 - - - - - 2 2 - - - - - 3 | | | | | | | | | 1 | | 2 | | | | | | | | | 4 - - - - - 5 5 - - - - - 6 [/code] Now, the outside edges are going to be data buffers of a sort. All four outside edges and the corners hold the connection data. As such, the inside part has to blocked with walls (as currently denoted with #). [code] 1 0 0 0 0 0 2 2 0 0 0 0 0 3 0 # # # # # 0 0 # # # # # 0 0 # # 0 0 # # 0 0 # 1 # 0 0 # 2 # 0 0 # # 0 0 # # 0 0 # # # # # 0 0 # # # # # 0 4 0 0 0 0 0 5 5 0 0 0 0 0 6 [/code] Open up a space in each as a walk-through from one plane to the other. [code] 1 0 0 0 0 0 2 2 0 0 0 0 0 3 0 # # # # # 0 0 # # # # # 0 0 # # 0 0 # # 0 0 # 1 0 0 2 # 0 0 # # 0 0 # # 0 0 # # # # # 0 0 # # # # # 0 4 0 0 0 0 0 5 5 0 0 0 0 0 6 [/code] When walked through, could use the corner data to know what to do, but that isn't good enough for an n dimensional system. That is, more than two planes could share the exact same corners, so a little bit more data has to be in the system. That extra bit of data is going to be the negative index of the plane to move to. When you step onto a negative number, that is how you know to move to the positive index plane. [code] 1 0 0 0 0 0 2 2 0 0 0 0 0 3 0 # # # # # 0 0 # # # # # 0 0 # # 0 0 # # 0 0 # 1 -2 -1 2 # 0 0 # # 0 0 # # 0 0 # # # # # 0 0 # # # # # 0 4 0 0 0 0 0 5 5 0 0 0 0 0 6 [/code] When running around plane 1, you walk onto -2 at the data buffer edge. The fact that -2 is negative means to move to next plane. Then, -2*-1 means move to plane 2. That's when the corner indices kick in for orientation. And, this is why the indices for the planes doesn't start at zero. You know, because -0. This whole thing means that you can connect in all sorts of ways. Look at the way planes 2 and 3 are connected. [code] 1 0 0 0 0 0 2 2 0 0 0 0 0 3 8 0 0 0 0 0 6 0 # # # # # 0 0 # # # # # 0 0 # # # # # 0 0 # # 0 0 # # 0 0 # # 0 0 # 1 -2 -1 2 -3 0 # 3 -2 0 # # 0 0 # # 0 0 # # 0 0 # # # # # 0 0 # # # # # 0 0 # # # # # 0 4 0 0 0 0 0 5 5 0 0 0 0 0 6 7 0 0 0 0 0 3 [/code] When you walk from plane 2 to plane 3, you use the corners to orient and re-arrange the map data for the plane being walked to. Here's one that will bake your brain: [code] 1 0 0 0 0 0 2 5 0 0 0 0 0 2 8 0 0 0 0 0 2 0 # # # # # 0 0 # # # # # 0 0 # # # # # 0 0 # -2 0 # -1 0 # # 0 0 # 1 # 0 0 # 2 -3 0 # 3 -2 0 # -3 0 # # 0 0 # -1 0 # # # # # 0 0 # # # # # 0 0 # # # # # 0 4 0 0 0 0 0 3 6 0 0 0 0 0 3 7 0 0 0 0 0 3 [/code] That is a basic example of more than two planes connected along the same edge (sharing two corners). One of the fun things is that the data for the next plane is re-oriented so that the corners match. This means that everything remains relative. Walking around the surface of a 3d cube can be disorienting if you don't have the visual in your brain. Three right turns on a cube can throw you for a loop if you don't know what's going on. I started this project because I wanted to walk around in a hypercube in 4d. This absolutely does do a 4d hypercube. As I got to thinking about it, it can do n dimensions. As a matter of fact, you can throw dimensions right out the window and connect planes in all sorts of willy-nilly ways. Well, as long as your map data is well crafted. I came up with this algorithm and coded it all on my own. Sitting under my rock and tapping away like the happy little code monkey that I am. Once I got this running to my satisfaction, I started drawing up maps, connecting things, and having a blast doing so. But I got to looking at some of my maps and my brain got tickled. Even though this was something that I had come up with on my own, there was something familiar about it. That map that I just drew... I know I've seen that structure before. So I started poking around the interwebs using various search terms. Turns out I had created a directed graph system. Now I know what to call it so other folks will know what I mean. While it is nice to have a formal name, but I was looking forward to calling it My More Than n-Dimensional Mapping System. More than n dimensions. Come on, that's funny. Kekeke. Once I get further along, I'll probably serve it up with some example maps. Or pass it to somebody else to serve. [small](Edited by [url=http://ozoneasylum.com/user/351]warjournal[/url] on 02-12-2016 18:35)[/small] [small](Edited by [url=http://ozoneasylum.com/user/351]warjournal[/url] on 02-12-2016 18:38)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »
Maximum Security
OZONE
DHTML/Javascript
Server-Side Scripting - Oh my!
CSS - DOM - XHTML - XML - XSL - XSLT
Stupid Basic HTML
Visual Therapy
Photoshop
Photoshop Pong, Anyone?
***WARNING*** BIG SIG APPROACHING
Photography
3D Modelling & Rendering
Multimedia/Animation
Print Graphics
Holding Pens
Philosophy and other Silliness
Outpatient Counseling
Site reviews!
Mad Scientists' Laboratory
Getting to know the Grail