[Code] Update Mesh

This commit is contained in:
Andre Meyering 2018-10-31 15:41:28 +01:00
parent 96a0749d91
commit 8d28fef13d

View file

@ -68,26 +68,27 @@ void displaycloud(int modus)
{ {
int i = 0; int i = 0;
float range[3]; float range[3];
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++){
range[i] = cpointsmax[i] - cpointsmin[i]; range[i] = cpointsmax[i] - cpointsmin[i];}
if (modus > 0) { if (modus > 0) {
if (modus == 1 || modus == 4) { // Display only the vertices if (modus == 1 || modus == 4) { // Display only the vertices
////////////////////// //////////////////////
// TODO: set fill mode to render only the vertices // TODO: set fill mode to render only the vertices
glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
////////////////////// //////////////////////
} }
if (modus == 2 || modus == 5) { // Display the outlines of the polygons if (modus == 2 || modus == 5) { // Display the outlines of the polygons
////////////////////// //////////////////////
// TODO: set fill mode to render only outlines // TODO: set fill mode to render only outlines
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
////////////////////// //////////////////////
} }
if (modus == 3 || modus == 6) { // Display filled polygons if (modus == 3 || modus == 6) { // Display filled polygons
////////////////////// //////////////////////
// TODO: set fill mode to render filled polygons // TODO: set fill mode to render filled polygons
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
///////////////////// /////////////////////
} }
glBegin(GL_TRIANGLES); // using the polygone mode "GL_TRIANGLES" glBegin(GL_TRIANGLES); // using the polygone mode "GL_TRIANGLES"
@ -111,6 +112,9 @@ void displaycloud(int modus)
// one triangle consists of 3 consecutive entries of ccoord, i.e. // one triangle consists of 3 consecutive entries of ccoord, i.e.
// first triangle consists of the vertices referenced in ccoord[0], ccords[1], ccoord[2]. // first triangle consists of the vertices referenced in ccoord[0], ccords[1], ccoord[2].
glVertex3f(cpoints[ccoord[i]*3],cpoints[ccoord[i]*3+1],cpoints[ccoord[i]*3+2]);
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
} }
glEnd(); glEnd();