mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 16:36:54 +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,
|
glScalef(_owningHead->getScale() * MODEL_SCALE, _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
|
// start with the base
|
||||||
int vertexCount = _geometry.vertices.size();
|
int vertexCount = _geometry.vertices.size();
|
||||||
int normalCount = _geometry.normals.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
|
// update the blended vertices
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, _vboID);
|
glBindBuffer(GL_ARRAY_BUFFER, _vboID);
|
||||||
glBufferSubData(GL_ARRAY_BUFFER, 0, vertexCount * sizeof(glm::vec3), _blendedVertices.constData());
|
glBufferSubData(GL_ARRAY_BUFFER, 0, vertexCount * sizeof(glm::vec3), _blendedVertices.constData());
|
||||||
|
|
Loading…
Reference in a new issue