本文整理汇总了C++中ofMesh::getTexCoord方法的典型用法代码示例。如果您正苦于以下问题:C++ ofMesh::getTexCoord方法的具体用法?C++ ofMesh::getTexCoord怎么用?C++ ofMesh::getTexCoord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofMesh
的用法示例。
在下文中一共展示了ofMesh::getTexCoord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: returnMeshWarpedToThisMesh
ofMesh meshPointAdder::returnMeshWarpedToThisMesh(ofMesh & meshToMatch){
// this could / should be optimized;
ofMesh newMesh;
vector < ofPoint > newPoints;
vector < ofPoint > newTexPoints;
for (int i = 0; i < ptsList.size(); i++){
int who = ptsListBarycentric[i].whichTriangle;
float a = ptsListBarycentric[i].a;
float b = ptsListBarycentric[i].b;
float c = ptsListBarycentric[i].c;
ofPoint newPos = ApplyBarycentric(
meshToMatch.getVertices()[who*3+0],
meshToMatch.getVertices()[who*3+1],
meshToMatch.getVertices()[who*3+2],a,b,c);
ofVec2f newTex = ApplyBarycentric(
meshToMatch.getTexCoord(who*3+0),
meshToMatch.getTexCoord(who*3+0),
meshToMatch.getTexCoord(who*3+0),a,b,c);
newPoints.push_back(newPos);
newTexPoints.push_back(newTex);
}
ofMesh objectMesh;
for(int i = 0; i < triangles.size(); i++){
ofVec3f p1 = newPoints[triangles[i].a];
ofVec3f p2 = newPoints[triangles[i].b];
ofVec3f p3 = newPoints[triangles[i].c];
objectMesh.addVertex(p1);
objectMesh.addVertex(p2);
objectMesh.addVertex(p3);
ofVec3f t1 = newTexPoints[triangles[i].a];
ofVec3f t2 = newTexPoints[triangles[i].b];
ofVec3f t3 = newTexPoints[triangles[i].c];
objectMesh.addTexCoord(t1);
objectMesh.addTexCoord(t2);
objectMesh.addTexCoord(t3);
}
return objectMesh;
}