How do I create a Gall-Peters map uv projection from a cube?

I have a cube which is subdivided into 16x16x6 faces. I plan to post process this cube into a sphere later on (by multiplying each normalized vertex by the desired radius) to be used as an asset in a game.

I need to create a UV map for this cube that will allow texturing with a gall-peters (or similar) world map projection, like this:

I’m not too sure how I should go about this. Sphere projection is not quite right. cylinder projection sort of works, but I have UVs at the top and bottom of the map that are cramped together, extending beyond the bounds of the map dimensions, and are connected oddly.

What I have been going it aligning my view using the 1 key and unwrapping from that position, but it is not enough.

Does anyone know a good way to go about this? Perhaps some suggestions on things to try?

from cube to one of the cylindrical maps is a bit easy
the perl code for “hugin” in CPAN can easily do it
http://hugin.sourceforge.net/
from the description of the map is this a “Space Engine” map ?

first i would tile the the parts of the face into one image for each face
then install hugin and the perl “panotools for hugin”

see the README
http://cpansearch.perl.org/src/BPOSTLE/Panotools-Script-0.28/README

or on sourceforge ( windows exe are there)

i use these tools to move between CUBE format and Simple cylindrical all the time

and use “cubic2erect”


 /usr/bin/cubic2erect front.tif right.tif back.tif left.tif up.tif down.tif equirectangular.tif

that will give you a image in Simple Cylindrical map projection

now to transform that into a “gall-peters”
you will need GDAL and Proj4

or GMT
“Generic Mapping Tools” from the Univ. of Hawaii

as to UV’s

but I have UVs at the top and bottom of the map that are cramped together,

is this a DEM height map ?
if so there is a “special” tool to convert a 16 bit Height map ( simple cylindrical) into a Tangent Normal map THAT !!! MAPS!!! to a SPHERE!!!
and NOT to a flat plain

JohnVV,

Thanks so much for the detailed response. This is all very fascinating! However, it doesn’t really help me. :confused:

I should explain what I use the UV’s for primarily. I pass the UV coordinates to a noise function. This noise function returns noise that is already mapped to a sphere projection (if you were to use the values to create a heightmap image, it would have gall-peters projection). This noise is then used to offset vertices to create terrain features.

All of this is done procedurally using seeds, and as such, there is no chance to do any pre-processing of the texture (as there really is no texture)

In order for all of this to work though, the UV mapping of the entire cube needs to match the projection the noise function uses.

The problem I am having is that the UV projetion I am currently using, while decent, does not match the projection used by the noise function.

I wonder if I could leverage the tools you mentioned to write code to convert the sphere projection to a cubemap, and then just use a cubemap uv though? I’m open to trying that, as it may be easier in the long run (I just don’t know the math behind doing that myself)

Ok i am lost

you have a “Cube” but it is NOT a cube map ???
it is a UV sphere grid
+90 north
-180 to 0 to +180
-90 south

that is not a cube unless you use a matrix transform to convert it

the use of “gall-peters projection” is i guess throwing me a bit off

it is a bit of an oddball map projection with a nasty distort at the equator

i have ONLY seen it in use in one and only one place
mapping of the equatorial region on our sun “sol” and even then only by one(1) institution out of MANY

the normal used format used in 3d is equalarea Simple cylindrical ( planetocentric 2 x 1 [ width x height ] size proportion )


and CUBE projection . Sinusoidal sometimes is used also

– normal cube map
http://8.t.imgbox.com/xAJJ96lV.jpg

– normal Simple Cylindrical
http://7.t.imgbox.com/T1PhtJ3G.jpg

i am a bit lost here so
1)
one bit of code uses spherical coordinates to make basically “Fractal noise”
( your basic Fractal planet generator )
2)
BUT
this code is messing up the equatorial area and using the very odd ball “gall-peters” mapping

i have ONLY seen it in use in one and only one place
mapping of the equatorial region on our sun “sol” and even then only by one(1) institution out of MANY

the normal used format used in 3d is equalarea Simple cylindrical ( planetocentric 2 x 1 [ width x height ] size proportion )
and CUBE projection . Sinusoidal sometimes is used also

or
is that a mapping coding error ?
“gall-peters” is basically a Cosine function done to the latitude

then you need to convert this “odd” cylindrical map to a normal one that most software uses
SEE: – normal Simple Cylindrical above

If a COS is being used on it
use a SIN on it

Where dose the cube come in ?

Ok I’ll try to break it down.

I start with a cube. I subdivide this cube into the desired detail. I change my viewport to hone in on one side using numpad1. I then UV mapped the cube using sphere projection. This worked out decently, but unfortunately is not correct. Here is what that looks like:


Next, I run a couple of python scripts I wrote. One of them chops this cube up into distinct objects, each one essentially a plane. The second script multiplies the normal of every vertex by a predefined radius value. This turns the cube into its sphere form.

Inside my game, I have a noise routine that returns values pre-mapped to a simple cylindrical (which after reading what you wrote, I may have misinterpreted as gall-peters). I feed it lat/long values, and the noise routine returns the correct data. I use the UV map to determine what the lat/long values should be. Here is a heightmap generated using the same noise:


NOTE: I am aware this is rectangular. It is the desired mapping I want to use. In reality, I currently use a square map, and an image is never created. I just want to demonstrate how the noise projection looks.

The problem is that the UV map above is incorrect. It works, but there is noticeable distortion in places like the poles, and areas of the final sphere that used to be the corners of the cube. There is also the fact that it is a square and not a rectangle, but that shouldn’t be relevant since I want to make a new UV map anyways.

Now, after reading what you wrote, I definitely confused this topic by saying I need gall-peters projection. Sorry about that! It is far more correct for me to say I need simple cylindrical. The example image you provided definitely looks like it would be correct.

So basically, how would I get blender to create a simple cylindrical UV map from a cube as shown above? I tried to simply use cylindircal mapping in blender, but the verts at the top and bottom of the map are all out of wack (connected together in unexplainable ways, and crammed on top of eachother; as well as extending beyond the right side boundary of the image.