Use wireframe to give piramids a more 3D feel.
This commit is contained in:
@@ -37,7 +37,8 @@ FlatLayerVisualisation::FlatLayerVisualisation(const LayerData &layer, Ordering
|
|||||||
|
|
||||||
const auto limit = (int) layer.numEntries();
|
const auto limit = (int) layer.numEntries();
|
||||||
auto data = layer.data();
|
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));
|
auto scalingMax = max(abs(*minElem), abs(*maxElem));
|
||||||
|
|
||||||
@@ -67,9 +68,16 @@ void FlatLayerVisualisation::render()
|
|||||||
glVertexPointer(3, GL_FLOAT, 0, vertexBuffer.get());
|
glVertexPointer(3, GL_FLOAT, 0, vertexBuffer.get());
|
||||||
glColorPointer(3, GL_FLOAT, 0, colorBuffer.get());
|
glColorPointer(3, GL_FLOAT, 0, colorBuffer.get());
|
||||||
glDrawElements(GL_TRIANGLES, faceCount * 3, GL_UNSIGNED_INT, indexBuffer.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_VERTEX_ARRAY);
|
||||||
glDisableClientState(GL_COLOR_ARRAY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlatLayerVisualisation::setVertexPositions(const int vertexNo, float *destination)
|
void FlatLayerVisualisation::setVertexPositions(const int vertexNo, float *destination)
|
||||||
|
|||||||
Reference in New Issue
Block a user