本文整理汇总了C++中HalfEdge::getNormAtVert方法的典型用法代码示例。如果您正苦于以下问题:C++ HalfEdge::getNormAtVert方法的具体用法?C++ HalfEdge::getNormAtVert怎么用?C++ HalfEdge::getNormAtVert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HalfEdge
的用法示例。
在下文中一共展示了HalfEdge::getNormAtVert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isPlanar
bool Face::isPlanar() {
float e = 0.01;
glm::vec3 norm;
float thisNorm;
HalfEdge* he = first;
while (true) {
norm = he->getNormAtVert();
thisNorm = glm::dot(*he->next->v->xyz, norm);
if (thisNorm < -e || thisNorm > e) {
return false;
}
he = he->next;
if (he == first) {
break;
}
}
return true;
}
示例2: generateNormArray
void Mesh::generateNormArray() {
if (normals != NULL) {
delete normals;
normals = 0;
}
normals = new float[getTotalVerts() * 4];
int j = 0;
HalfEdge* he = NULL;
float* normX;
float* normY;
float* normZ;
float* normH;
Vertex* v;
glm::vec3 norm;
for (int i = 0; i < faces->size(); i++) {
he = faces->at(i)->first;
v = he->v;
while (true) {
norm = he->getNormAtVert();
normX = new float(norm.x);
normals[j] = *normX;
delete normX;
j++;
normY = new float(norm.y);
normals[j] = *normY;
delete normY;
j++;
normZ = new float(norm.z);
normals[j] = *normZ;
delete normZ;
j++;
normH = new float(0.0f);
normals[j] = *normH;
delete normH;
j++;
he = he->next;
if (he == faces->at(i)->first) {
break;
}
}
}
}