glNormal*()的作用

[OpenGL Redbook p47] Use glNormal*() to set the current normal to the value of the argument passed in. Subsequent calls to glVertex*() cause the specified vertices to be assigned the current normal. Often, each vertex has a different normal, which necessitates a series of alternating calls, as in the example.

Example:Surface Normals at Vertices

glBegin (GL_POLYGON);

glNormal3fv(n0);

glVertex3fv(v0);

glNormal3fv(n1);

glVertex3fv(v1);

glNormal3fv(n2);

glVertex3fv(v2);

glNormal3fv(n3);

glVertex3fv(v3);

glEnd();

 

PSglNormal*() 用来设置当前的法向量,这个法向量将被应用到紧接下来的glVertex*() 所定义的顶点上。但是通常各个顶点的法向是各不相同的,所以我们通常在定义每个顶点之前都为它确定一次法向量。

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页