Rotating a line to create a solid

is it possible to create a solid by rotating a line in opengl?

No, not really. If you want to render a solid, just use the line endpoints for drawing the polygon.