https://twitter.com/PeterOnion/status/1 ... 3998162944
The right hand is drawn using the same mesh as the left hand but with the x coordinate reversed in the vertex shader.
Code: Select all
posn = a_position;
posn.x *= u_mirrorX;
posn = (u_handRotate * posn) + u_handTranslate;
u_mirrorX is 1 for left hand and -1 for right hand.
The result was fine until I turned on glCullFace(GL_BACK);
Now the right hand shows the wrong side of the faces as I assume the reflection has reversed the handedness of the triangles in the mesh.
My quick fix has been to temporarily swap to glCullFace(GL_FRONT); while drawing the right hand, but that feels like a bit of a kludge.
Is there a better way to fix this ?
PeterO