In 3D graphics, a triangle element has two surfaces.
In dx, we think that in the camera coordinate system, the side of the triangle that you observe is clockwise and the other side is the back, while in OpenGL, the opposite is better. (The vertex direction is also called surround)
DX is the left-hand coordinate system, while OpenGL is the right-hand coordinate system.
DX:
D3drs_cullmode, Drawing status
Usage: Device-> setrenderstate (d3drs_cullmode, X );
X value
1. d3dcull_none // completely disable backend hiding
2. d3dcull_cw // only fades out triangles in clockwise order.
3. d3dcull_ccw // only fades out the triangles in the clockwise direction (the default value is in the blanking)
DX reference: http://blog.csdn.net/yaoxinchao/article/details/7982099
OpenGL:
Void
Glfrontface(Glenum
Mode) Is used to control how the front of a polygon is determined. By default, it is gl_ccw (counterclockwise ). Gl_ccw indicates that the vertex sequence of the projection Polygon on the window coordinate is clockwise and the surface is positive. Gl_cw indicates that the face in clockwise direction of the vertex is positive. Gl_cull_face: gldisable (gl_cull_face). Disable glcullface: Specify the glcullface () parameters of the polygon face removal operation, including gl_front and gl_back. Disables illumination, shadow, and color calculation and operations on the front or back of a polygon to eliminate unnecessary rendering calculations. In summary, if we set to draw only the triangle elements on the front side during the backend hiding, in your pilot project, if this triangle element is identified as the front, it is drawn and removed if it is regarded as the back (this triangle will not be rendered, instead of removing the surface of the back of the triangle ), therefore, we need to ensure that the vertices of a closed model are consistent. If they are inconsistent and the backend is used to hide them, we may see that part of the model is missing.