diff --git a/sources/main.cpp b/sources/main.cpp index 09538b3..3419eb5 100755 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -143,12 +143,24 @@ this->setNormal(); col->setColor(); for (int v = 0; v < 3; v++) { - glVertex3f (scale * p[v]->x, scale * p[v]->y, scale * p[v]->z); + glVertex3f(scale * p[v]->x, scale * p[v]->y, scale * p[v]->z); } glEnd(); + this->drawNormals(); this->print(); } + void drawNormals() { + for (int v = 0; v < 3; v++) { + glBegin (GL_LINES); + glVertex3f(scale * p[v]->x, scale * p[v]->y, scale * p[v]->z); + glVertex3f(scale * p[v]->x + this->normal->x, + scale * p[v]->y + this->normal->y, + scale * p[v]->z + this->normal->z); + glEnd(); + } + } + void setNormal() { glNormal3f(this->normal->x, this->normal->y, this->normal->z); }