本文整理汇总了C++中Triangle::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ Triangle::Init方法的具体用法?C++ Triangle::Init怎么用?C++ Triangle::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Triangle
的用法示例。
在下文中一共展示了Triangle::Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateTris
void Grid::UpdateTris() {
int i, j;
Polygon* poly;
Triangle* tri;
for( i = 0; i < nPolys; i++ ) {
poly = polys[i];
for( j = 0; j < poly->n; j++ ) {
tri = poly->tris[j];
tri->a[0] = poly->verts[j][0];
tri->a[1] = poly->verts[j][1];
tri->b[0] = poly->verts[(j+1)%poly->n][0];
tri->b[1] = poly->verts[(j+1)%poly->n][1];
tri->c[0] = poly->origin[0];
tri->c[1] = poly->origin[1];
tri->Init();
/* update the triangle edges */
tri->ab->v1[0] = tri->a[0];
tri->ab->v1[1] = tri->a[1];
tri->ab->v2[0] = tri->b[0];
tri->ab->v2[1] = tri->b[1];
tri->ab->Init();
tri->bc->v1[0] = tri->b[0];
tri->bc->v1[1] = tri->b[1];
tri->bc->v2[0] = tri->c[0];
tri->bc->v2[1] = tri->c[1];
tri->bc->Init();
tri->ca->v1[0] = tri->c[0];
tri->ca->v1[1] = tri->c[1];
tri->ca->v2[0] = tri->a[0];
tri->ca->v2[1] = tri->a[1];
tri->ca->Init();
}
}
}
示例2: Init
void Init() {
// sets background color
glClearColor(0.937, 0.937, 0.937 /*gray*/, 1.0 /*solid*/);
triangle.Init();
}