Hi, I’ve been having real trouble figuring out how to draw normals as lines. Right now for my project I’m working on smoothing out a cylinder. I’ve created normals for the faces and so far it looks fine. I just can’t grasp how to draw lines to indicate where the normals are.
Here’s a snipped of code.
// draw bottom boundary:
glBegin ( GL_TRIANGLE_STRIP);
p1[0] = ctx; p1[1] = cty; p1[2] = ctz;
p2[0] = ntx; p2[1] = nty; p2[2] = ntz;
p3[0] = 0; p3[1] = -len; p3[2] = 0;
getNormals( p1, p2, p3, topTriangle);
glNormal3f(topTriangle[0],topTriangle[1],topTriangle[2]);
glVertex3d ( cbx, cby, cbz ); glVertex3d ( nbx, nby, nbz ); glVertex3d ( 0, -len, 0 );
glEnd();
This is for the bottom circle of my cylinder.
Any help would be greatly appreciated.