OpenGL draws primitives points, line segments, or polygonssubject to several selectable modes. You can control modes independently of one another. That is, setting one mode doesn't affect whether other modes are set (although many modes may interact to determine what eventually ends up in the framebuffer). To specify primitives, set modes, and perform other OpenGL operations, you issue commands in the form of function calls.
OpenGL根据几种可选模式绘制基本的点、线段或多边形。您可以彼此独立地控制模式。也就是说,设置一个模式不会影响是否设置了其他模式(尽管许多模式可能会相互作用,以确定最终会在framebuffer中设置什么模式)。要指定基本类型、设置模式和执行其他OpenGL操作,可以以函数调用的形式发出命令。
Primitives are defined by a group of one or more vertices. A vertex defines a point, an endpoint of a line, or a corner of a polygon where two edges meet. Data (consisting of vertex coordinates, colors, normals, texture coordinates, and edge flags) is associated with a vertex, and each vertex and its associated data are processed independently, in order, and in the same way. The only exceptions to this rule are cases in which the group of vertices must be clipped so that a particular primitive fits within a specified region. In this case, vertex data may be modified and new vertices created. The type of clipping depends on which primitive the group of vertices represents.
基元由一个或多个顶点组成的组定义。顶点定义了两点相交的点、线的端点或多边形的角。数据(由顶点坐标、颜色、法线、纹理坐标和边缘标志组成)与一个顶点相关联,每个顶点及其关联的数据按顺序以相同的方式独立处理。这条规则的唯一例外是顶点组必须被裁剪,以使特定的基元适合于指定的区域。在这种情况下,可以修改顶点数据并创建新的顶点。裁剪的类型取决于顶点组表示的原语。
Commands are always processed in the order in which they are received, although there may be an indeterminate delay before a command takes effect. This means that each primitive is drawn completely before any subsequent command takes effect. It also means that state-querying commands return data that is consistent with complete execution of all previously issued OpenGL commands.
命令总是按照接收命令的顺序处理,尽管在命令生效之前可能有一个不确定的延迟。这意味着在任何后续命令生效之前,将完全绘制每个原语。它还意味着状态查询命令返回的数据与之前发出的所有OpenGL命令的完整执行一致。