c++ - Incorrect OpenGL winding -
when initializing opengl, set following:
glenable(gl_cull_face); glfrontface(gl_ccw); glcullface(gl_front); then, draw triangle on screen. that's do, really. opengl uses opposite winding type of specify using glfrontface.
the triangle vertices defined follows:
static glfloat triangle[] = { 0.0f, 0.5f, 0.0f, // point 1 on image -0.5f, -0.5f, 0.0f, // point 2 0.5f, -0.5f, 0.0f, // point 3 }; you can see results on following image:

what expect gl_ccw draws triangle , cl_cw doesn't. happens opposite.
my perspective , view matrices correct. cause problem?
glcullface specifies side gets culled away, not side drawn. when triangle given in ccw order , enable way do, front faces (ccw faces) culled away , nothing drawn.
Comments
Post a Comment