Convert Cubemap pixel coordinates to equivalents in Equirectangular
I have a set of coordinates of a 6-image Cubemap (Front, Back, Left, Right, Top, Bottom) as follows:
[ [160, 314], Front; [253, 231], Front; [345, 273], Left; [347, 92], Bottom; ... ]
Each image is 500x500p, being [0, 0] the top-left corner. I want to convert these coordinates to their equivalents in equirectangular, for a 2500x1250p image.
I don't need to convert the whole image, just the set of coordinates. Is there any straight-forward conversion for a specific pixel?
EDIT:
First of all, I want to insist on the fact that I don't have any image available, neither the 6 input images from the cubemap, nor the output equirectangular pano. What I have available is a set of pixel coordinates from 6 images that shape a skybox cubemap. I add a graphic example using 250x250p images:
Front image:
Right image:
And so on for the other 4 images (Back, Left, Top, Bottom).
I have set in red some points, these points will be my input. Those points would have their equivalents in an equirectangular panorama:
I have used a 1000x500p pano in this case.
So the input is the pixel coordinates [x,y] of the red points in the cubemap, together with the image they belong to. The [0,0] pixel is the top-left corner of each image:
{ Lamp1: [194,175], front; Chair: [151,234], front; TV: [31,81], right; Door: [107,152], back; Lamp2: [125,190], left }
And the output I want to obtain is the pixel coordinates of the red points in the equirectangular panorama:
{ Lamp1: [831,304]; Chair: [784,362]; TV: [898,206]; Door: [228,283]; Lamp2: [500,326] }
I would like to know how to map from one set of coordinates to the other:
CUBEMAP [194,175], front -> ? -> [831,304] EQUIRECTANGULAR
can you explain those "coordinates" a bit more ? maybe even add the cubemap image to your question ?
@berak That's the point, I don't have the images. I explained it up above, I have a set of [x,y] pixel coordinates, coming from a set of 6 images (Front, Back, Left, Right, Top, Bottom), conforming a cubemap.
Each image is 500x500p and the origin [0,0] is at the top-left corner. I want to obtain the corresponding [x',y'] pixel in an equirectangular 2500x1250p panorama.
I don't want to convert the whole cubemap, just a specific pixel, knowing the image it belongs to.
ok, so we got a cross like skybox. look at the coords above, they don't make any sense. also, front appearing twice.
there's well known formulas using remap for this, but we need to verify your input first
@berak That's a script I am getting as input. It does make sense, e.g.: "[160, 314], Front" means the pixel x=160, y=314 from the front image, "[253, 231], Front" the pixel x=253, y=231 from the front image, "[345, 273], Left" the pixel x=347, y=92 from the left image and so on. I want to remap only the provided coordinates in the script to equirectangular.
Have you seen: http://paulbourke.net/miscellaneous/c... (especially "Converting to and from 6 cubic environment maps and a spherical map").
Maybe, if you can't figure it out, you could write to Paul Bourke and see if he has a clue for you.
You might also want to try asking your question on the gamedev.net forums. Environment maps are used in a lot of games, so someone might have some information for you.
@berak I don't get any coordinates, I obtain them from the output of another algorithm. Ok, I thought I was being pretty clear, but I'll edit the question with a graphic example when I find a free spot. Thank you for your help. @sjhalayka Thanks, I'll have a look to that.
@berak I've just edited the question. Hope it is clear now for you.
@Finfa811 , entirely, thanks a lot !