Closed-System Cartesian Coordinates?

I’m trying to accomplish something like this,

bi4b45tMEPE

See how when the continents move, and the points of color at the bottom are moved to the top simultaneously.

The top-most coordinate system is what I am looking for. But for example, if I had a grid of objects like so,

Object[][] 2DUniverse;

How would I make the bottom most universe react like the one above? Using out of bounds checks?

I may be having a brain-fart. Can someone please help me?
Thanks in advance.

I’d treat the top and bottom row of the 2D grid as the north and south pole. The left and right sides connect together. If you need to cross through the poles, i.e Move past the top row to the bottom row, then instead of shifting the object vertically, you’d instead shift horizontally by (width / 2), and start moving in the opposite direction.

I’m really looking for a matrix transform I can do on 2D coordinates to move them from a Cartesian plane to a Gall-Peters style projection, however I would do that. Thanks for the reply though!

This is not possible using a common transformation matrix.
The problem is that matrices (for which the matrix-vector multiplication is defined as 4 dot products) can only represent ‘linear’ (i.e. “affine”) transformations and perspective/orthogonal projections.
And ‘linear’ meaning that, in order to produce the output vector from an input vector, you can only apply simple ‘+’ and ‘*’ operators that only directly take the vector components as operands.
Now, the formula for Gall-Peters projection has a non-linear component between input and output, namely the sine.
But, there you have the transformation formula and can apply this to your coordinates.

And you can’t map a finite part of the 2D plane to the surface of a 3D sphere without distortion…to be not too mathy.

(And you can use linear algebra to do these kinds of transforms.)

That’s what I was looking for, I already have the data from continents and all set into a 2D plane, but I want to make a separate image of the Gall-Peters projection.

Okay, that explains the “Linear Algebra” titles matrices have… xD Thanks
The equations were made to turn a coordinate space of a sphere to a 2D plane, I’m looking for a solution to convert the 2D plane to a distorted 2D plane as if it was projected. I know it sounds like I’m just looking for a quick solution (and I probably don’t have a correct understanding at all). I really am still learning this stuff.

Thanks for the reply!

Think cube mapping

So instead of having one 2D array I have six for each cube side? How would that look in code?

I should be a bit more clear about my question,
I’m looking for two things, a way for things on a 2D map to wrap around the coordinate system like a sphere, and a way to then project that to a Gall-Peter’s projection. The final product should look something like this image of the earth.

So a simulation like the one in the video above should produce a map like the image above, the question is what type of coordinate system should it be simulated in (using whole numbers of course) and how to then project it.

Ideally you just simulate the surface of a sphere in some spherical coordinate system, and projection is just converting that into longitude/latitude (if that wasn’t already the representation), for which Gall-Peters is already defined. Collision detection etc. on a sphere might be fun though.

That sounds like allot more work than I thought I got myself into. I’m trying to simulate the tectonic plate movement, which isn’t easy in itself. But the final product really only has to be a map for a sphere I can apply to in blender. So would there be a better option for this such as doing the simulation in a cube map? Because that’d be heck of allot easier than collision detection on a sphere :o

Please think cube maps. There are other options but they are all significantly harder.

With all do respect, I know the Gall-Peters sucks. But it can be mapped to a sphere very easily (according to blender that is). All I really need is a way to map my Java simulation onto a sphere. And I do not mind using cube maps at all, the only thing is that I have little knowledge on them, and to be honest they’re confusing. But if all the other’s are much harder I’ll see if I can find some articles on them. Thanks for the info!

(For the record Robinson = The Best)

Turns out It’s as simple as that. For my stupidity and not googling obvious answers I will now give everyone a medal.

Mapping a static image and updating “cells” is somewhat different. Going this route means you have to avoid the poles.

What are you doing with the cells of the grid? Working directly is 3D is probably easiest solution assuming your conformable in 3D. Also note that the space distortions cause various simple projections don’t matter if you want to just perform collision detection in 2D. (I haven’t really thought this through if it would make sense or not).