A vertex set:
private float vertices[] = { -1.0f, 1.0f, 0.0f, // 0, Top Left -1.0f, -1.0f, 0.0f, // 1, Bottom Left 1.0f, -1.0f, 0.0f, // 2, Bottom Right 1.0f, 1.0f, 0.0f, // 3, Top Right 2.0f, 1.0f, 0.0f, // 4, Top 2Right 2.0f, -1.0f, 0.0f, // 5, Bottom 2Right};
Set to draw only the front (counterclockwise)
GL. glfrontface (gl10.gl _ CCW); // OpenGL docs // enable face culling. GL. glable (gl10.gl _ cull_face); // OpenGL docs // What faces to remove with the face culling. // GL. glcullface (gl10.gl _ front_and_back); // OpenGL docs removes the rendering GL from a certain surface. glcullface (gl10.gl _ Back); // OpenGL docs
Use gl10.gl _ triangle_strip
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0,6);
According to the online tutorial, the triangle should be drawn as follows:
012 (), 123 (), 234 (clockwise), 345 (clockwise)
The first two triangles are displayed. The actual result is that the values 0 12 (counterclockwise), 345 (clockwise ),
Searching for details
To sum up, we found that the triangle at the even position was calculated in reverse order, that is, it turns clockwise in the original clockwise direction.