mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
Temporarily render the normals for debugging.
This commit is contained in:
parent
c7bb523fc5
commit
807f6aaf14
1 changed files with 12 additions and 2 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue