Commit 53034976 authored by Neloress's avatar Neloress
Browse files

fix

parent fb39b660
......@@ -24,7 +24,7 @@
using namespace std;
int minVerticies = 1;//16;
int minVerticies = 512;//16;
int maxIterations = numeric_limits<int>::max();
float minAngle = 0.2;
......@@ -135,7 +135,7 @@ vector<float*> prepareColorsForNeighborCount()
}
vector<float*> colors;
for (float f = 0; f <= 1; f += (1.0 / maxNeighors))
for (float f = 0; f <= 1.0001; f += (1.0 / maxNeighors))
{
colors.push_back(new float[4]{ f, 1.0f - f, 0, 1 });
}
......@@ -178,6 +178,7 @@ void renderScene() // this function is called when you need to redraw the scene
glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
glBegin(GL_TRIANGLES);
int pos;
for (size_t i = 0; i < allTriangles.size(); i++)
{
......@@ -188,7 +189,13 @@ void renderScene() // this function is called when you need to redraw the scene
glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
break;
case 1: // neighbor count
glMaterialfv(GL_FRONT, GL_DIFFUSE, neighborColors[allTriangles.at(i).neighborCountTriangles]);
pos = (allTriangles.at(i).neighborCountTriangles - 3);
if (pos<0)
{
pos = 0;
}
glMaterialfv(GL_FRONT, GL_DIFFUSE, neighborColors[pos]);
break;
case 2: // colors for face normals
glMaterialfv(GL_FRONT, GL_DIFFUSE, calcNormalColor(allTriangles.at(i).flatShading));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment