Temporarily render the normals for debugging.

This commit is contained in:
Andrzej Kapolka 2013-09-23 12:20:19 -07:00
parent c7bb523fc5
commit 807f6aaf14

View file

@ -46,8 +46,6 @@ bool BlendFace::render(float alpha) {
glScalef(_owningHead->getScale() * MODEL_SCALE, _owningHead->getScale() * MODEL_SCALE,
-_owningHead->getScale() * MODEL_SCALE);
glColor4f(_owningHead->getSkinColor().r, _owningHead->getSkinColor().g, _owningHead->getSkinColor().b, alpha);
// start with the base
int vertexCount = _geometry.vertices.size();
int normalCount = _geometry.normals.size();
@ -72,6 +70,18 @@ bool BlendFace::render(float alpha) {
}
}
glColor3f(1.0f, 0.0f, 0.0f);
glBegin(GL_LINES);
for (int i = 0; i < vertexCount; i++) {
glVertex3f(_blendedVertices.at(i).x, _blendedVertices.at(i).y, _blendedVertices.at(i).z);
glm::vec3 end = _blendedVertices.at(i) + glm::normalize(_blendedNormals.at(i)) * 10.0f;
glVertex3f(end.x, end.y, end.z);
}
glEnd();
// use the head skin color
glColor4f(_owningHead->getSkinColor().r, _owningHead->getSkinColor().g, _owningHead->getSkinColor().b, alpha);
// update the blended vertices
glBindBuffer(GL_ARRAY_BUFFER, _vboID);
glBufferSubData(GL_ARRAY_BUFFER, 0, vertexCount * sizeof(glm::vec3), _blendedVertices.constData());