Use wireframe to give piramids a more 3D feel.

This commit is contained in:
2018-03-22 15:30:30 +01:00
parent d4ed6e0c0f
commit effa90c178

View File

@@ -37,7 +37,8 @@ FlatLayerVisualisation::FlatLayerVisualisation(const LayerData &layer, Ordering
const auto limit = (int) layer.numEntries();
auto data = layer.data();
const auto [minElem, maxElem] = minmax_element(data, data + limit);
const auto
[minElem, maxElem] = minmax_element(data, data + limit);
auto scalingMax = max(abs(*minElem), abs(*maxElem));
@@ -67,9 +68,16 @@ void FlatLayerVisualisation::render()
glVertexPointer(3, GL_FLOAT, 0, vertexBuffer.get());
glColorPointer(3, GL_FLOAT, 0, colorBuffer.get());
glDrawElements(GL_TRIANGLES, faceCount * 3, GL_UNSIGNED_INT, indexBuffer.get());
glDisableClientState(GL_COLOR_ARRAY);
// Now draw wireframe
glColor4f(0, 0, 0, 1);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glDrawElements(GL_TRIANGLES, faceCount * 3, GL_UNSIGNED_INT, indexBuffer.get());
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
}
void FlatLayerVisualisation::setVertexPositions(const int vertexNo, float *destination)