GL_ARB_texture_cube_map extension documentation (http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_cube_map.txt)
gives the following formula to compute s and t coordinates for the selected face
s = ( sc/|ma| + 1 ) / 2
t = ( tc/|ma| + 1 ) / 2
(See the table in the doc. for the sc,tc and ma. Make a text search for the above lines )
Now, if I understand the table and formula correctly if I have <0,0.5,1> as input:
major axis is +z (so positive z face texture will be used )
sc = +rx = 0
tc = -ry = -0.5
ma = 1
s = 0.5
t = 0.25
So, even though my vector looks above the x-z plane (it has positive y value) it returns me a texel from below the middle line of the face. Try with <0,-0.5,1> and you get 0.5 , 0.75. It is as if the image is mapped inversely.
This is what I experience in the application I am working on now. I am making dynamic cube mapping and it works only if I generate cube faces with a camera which has the up vector towards the ground instead of sky.
The problem is none of the articles I saw mentions this. All cube map images I saw are (you know those unfolded ones) are with up=+Y.
So it seems like I am missing something. Any ideas?