Small man (Bill man) Personal Original, welcome to reprint, reprint please indicate the address, small man (Bill man) column address http://blog.csdn.net/bill_man
The last time I talked about the triangle draw mode, there are other ways to draw the triangle, which will be described in this article.
1. gl_points
As the name suggests, it is a separate drawing point. The Nth point in the index draws the point N.
2. gl_lines
That is, two adjacent points (2N points and 2n + 1 points) are connected in groups. If the number of points is the base, the last point is ignored, for example) it is an index, with 0 and 1 digits in one group, and 2 and 3 digits in one group.
3. gl_line_strif
Connect two adjacent vertices. Different from the above, the N vertex is connected to the n + 1 vertex. For example, (,) is an index, and the 0 vertex is connected to 1 vertex, connect 1 to 2, and connect 2 to 3.
4. gl_line_loop
Connect two adjacent vertices. The same as above, the difference is that the last vertex must be connected to 0th. For example, (,) is an index and 0 is connected to 1, 1 to 2 connections, 2 to 3 connections, and 3 to 0 connections.
5. gl_triangles
3n, 3N + 1, and 3N + 2 vertices form a triangle, and the remainder vertex left is ignored. For example, (,) is an index, and 1, 2, and 3 constitute a triangle, 4, 5, and 6 form a triangle.
6. gl_triangles_strif
Connect two adjacent vertices into a triangle. Different from the preceding vertex, the nth vertex is connected to the nth vertex, for example (,) as the index, A triangle consists of 0, 1 and 2, and a triangle consists of 1 and 2 and 3.
7. gl_triangles_fan
A triangle consists of 0th vertices and the following vertices. For example, (,) is an index. A triangle consists of 0 and 2 and 3.
There are two ways to draw, respectively the index method and the vertex Method
1. the indexing method first defines the index buffer when drawing. The first parameter of gldrawelements is the fill type, the second parameter is the number of vertices, and the third parameter is the data cache type, here is the byte type, and the last parameter is the data cache parameter.
2. the vertex method does not need to define the index buffer. The first parameter of gldrawelements is the fill type, the index starts when the second parameter is used, and the third parameter is the number of vertices.
Refer to the detailed explanation and typical cases of Android 3D Game Development Technology. If there are any errors, I hope you can correct them more.
Next article: Projection