How to draw a pipe?

I have question how can I draw pipe in opengl? I am using C++ and glut, I found something like this but i dont understand the code:

	int ACC=48;
    float a,p,q;
    int i;
    for (i=0;i<=ACC;i++)
	a = i*PI*2/ACC;
	p = cos(a);
	q = sin(a);
	glNormal3f(p, q, 0.4);
	glVertex3f(0.7*p, 0.7*q, 0.8);
	glNormal3f(0.0, 0.0, 1.0);
	glVertex3f(0.7*p, 0.7*q, 10);

Generaly I want to draw a spring but not with gl_Line_Stripe becouse i must to put material on it:(

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.