本文整理汇总了C++中Transformation::applyTransformation方法的典型用法代码示例。如果您正苦于以下问题:C++ Transformation::applyTransformation方法的具体用法?C++ Transformation::applyTransformation怎么用?C++ Transformation::applyTransformation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transformation
的用法示例。
在下文中一共展示了Transformation::applyTransformation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
void Draw()
{
glBindTexture(GL_TEXTURE_2D, texture);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, material.diffuse);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, material.specular);
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, material.emissive);
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, material.shininess);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
mesh_transform.applyTransformation();
glBegin(GL_TRIANGLES);
for (int i = 0; i < mesh.num_of_indices; i++)
{
Vertex& curVertex = mesh.vertices[mesh.indices[i]];
glTexCoord2f(curVertex.texture_coord.U, curVertex.texture_coord.V);
glNormal3f(curVertex.normal.X, curVertex.normal.Y, curVertex.normal.Z);
glVertex3f(curVertex.position.X, curVertex.position.Y, curVertex.position.Z);
}
glEnd();
glPopMatrix();
}
示例2: BeginDraw
void BeginDraw()
{
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
transform.applyTransformation();
}