PDA

View Full Version : What does cubemap being left-handed really mean?



MalcolmB
05-04-2009, 04:26 PM
Hey, I'm trying to understand what the fact that cubemaps use a left-handed coordinate system really means in practical terms.
Let's say I'm just using the cubemap for a skybox, so I sample the cubemap using

texcoord = gl_Vertex - (gl_ModelViewMatrixInverse * vec4(0,0,0,0,1));

Now for example I have a vertical cross I'm loading in, such as one you see here (http://www.cgtextures.com/tutorials/cubemaps/images/cubemap_layouts.gif).

Now everything I read tells me I should load the upper middle section (the section below the top section) into POSITIVE_Z, since cubemaps are left handed, and the bottom section into NEGATIVE_Z. However if I do that, with my skybox code the images don't match up, since we render using a right handed coordinate system. If I swap the images I load into POSITIVE_Z and NEGATIVE_Z, everything lines up nicely.

However I'm wondering if this will break anything? Is there any filtering or other features that this may cause unexpected results with?

If this is fine to do, then is the handedness of cubemaps really just a way to define the 2d orientation of each individual image in relation to each other (i.e what kind of flip needs to be applied to the image in x and/or y to get them to line up correctly).

Thanks