"I rendered a triangle mesh face-by-face (as usual in OpenGL, but DirectX normally requires a different approach) and I set three min-curvature directions (because each face has 3 vertices) for all vertices for each face. Here I attach some part of my source code:
glBegin(GL_TRIANGLES);
// set curvature values as texture coordinates.
glMultiTexCoord3fv(GL_TEXTURE0, face.getVertex(0).getTexCoord
glMultiTexCoord3fv(GL_TEXTURE1, face.getVertex(1).getTexCoord
glMultiTexCoord3fv(GL_TEXTURE2, face.getVertex(2).getTexCoord
glMultiTexCoord3fv(GL_TEXTURE3, face.getVertex(0).getTexCoord
glMultiTexCoord3fv(GL_TEXTURE4, face.getVertex(1).getTexCoord
glMultiTexCoord3fv(GL_TEXTURE5, face.getVertex(2).getTexCoord
for(int k = 0; k < 3; k++)
glVertex3fv(face.getVertex(k)
...
glEnd();
In this code, face.getVertex(i) retrieves the vertex index of the face and getTexCoord(j) retrieves the texture coordinate of the vertex. And I used multi-texturing to set three min-curvature directions for each face.
Therefore, all vertices in a face have three texture coordinates whose values are min-curvature directions.
(Also have three max-curvature directions, total 6.)"
No comments:
Post a Comment