In OpenGL, the default setup is:
- Co-ordinate system = right handed, with
+x->right, +y->up, +z->towards-viewer
. - Therefore, a postive rotation around z will move the x basis vector to y (anti-clockwise).
- Front-facing polygons are defined as CCW vertices.
- Culling of backface faces is achieved by:
glEnable(GL_CULL_FACE); glCullFace(GL_BACK);
Ok, we all know this. In Flash 11/Molehill/Stage3d
, the defaults are supposed to be the same.
However, if I enable backface culling in step 4 via:
c3d.setCulling(Context3DTriangleFace.BACK);
my faces are culled. It seems the default is Context3DTriangleFace.FRONT. I created a sanity-check case in OpenGL and Stage3D which are otherwise identical. Same vertex/index list, leave defaults, same orthographic projection matrix, identity ModelView, yet I have to set culling to FRONT not BACK.
It's as if Stage3D has a different winding default. i.e. it's as if, under the hood, OpengGL has been set to: glFrontFace(GL_CW); instead of OpenGLs default: glFrontFace(GL_CCW);
Has anyone else come across this? It's driving me nuts...