Commit da735819 authored by Benjamin Wagner's avatar Benjamin Wagner
Browse files

Grayscale Vertex Triangleneighbour Count

parent 542c071f
......@@ -368,12 +368,12 @@ void renderScene() // this function is called when you need to redraw the scene
// NOW HERE YOU CAN DRAW WHAT YOU WANT! :) --------------------------------------------------------------
glColorMaterial(GL_FRONT, GL_AMBIENT);
glColorMaterial(GL_FRONT, GL_DIFFUSE);
glColorMaterial(GL_FRONT, GL_SPECULAR);
// glColorMaterial(GL_FRONT, GL_AMBIENT);
// glColorMaterial(GL_FRONT, GL_DIFFUSE);
// glColorMaterial(GL_FRONT, GL_SPECULAR);
glMaterialfv(GL_FRONT, GL_AMBIENT , mat_ambient);
glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
// glMaterialfv(GL_FRONT, GL_AMBIENT , mat_ambient);
// glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
glBegin( GL_TRIANGLES );
......@@ -388,7 +388,10 @@ void renderScene() // this function is called when you need to redraw the scene
numberOfTriangles = vertexTriangleMap[triangle.m_p1].size();
numberOfTriangles /= (GLfloat)maxTriangles;
glColor3f(numberOfTriangles, numberOfTriangles, numberOfTriangles);
float colorOne[] = { numberOfTriangles, numberOfTriangles, numberOfTriangles, 1.0f };
glMaterialfv(GL_FRONT, GL_DIFFUSE, colorOne);
// glColor3f(numberOfTriangles, numberOfTriangles, numberOfTriangles);
glVertex3f(triangle.m_p1.m_x, triangle.m_p1.m_y, triangle.m_p1.m_z);
......@@ -396,7 +399,9 @@ void renderScene() // this function is called when you need to redraw the scene
numberOfTriangles = vertexTriangleMap[triangle.m_p2].size();
numberOfTriangles /= (GLfloat)maxTriangles;
glColor3f(numberOfTriangles, numberOfTriangles, numberOfTriangles);
float colorTwo[] = { numberOfTriangles, numberOfTriangles, numberOfTriangles, 1.0f };
glMaterialfv(GL_FRONT, GL_DIFFUSE, colorTwo);
// glColor3f(numberOfTriangles, numberOfTriangles, numberOfTriangles);
glVertex3f(triangle.m_p2.m_x, triangle.m_p2.m_y, triangle.m_p2.m_z);
......@@ -404,7 +409,9 @@ void renderScene() // this function is called when you need to redraw the scene
numberOfTriangles = vertexTriangleMap[triangle.m_p3].size();
numberOfTriangles /= (GLfloat) maxTriangles;
glColor3f(numberOfTriangles, numberOfTriangles, numberOfTriangles);
float colorThree[] = { numberOfTriangles, numberOfTriangles, numberOfTriangles, 1.0f };
glMaterialfv(GL_FRONT, GL_DIFFUSE, colorThree);
// glColor3f(numberOfTriangles, numberOfTriangles, numberOfTriangles);
glVertex3f(triangle.m_p3.m_x, triangle.m_p3.m_y, triangle.m_p3.m_z);
}
......
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