- procedure draw_zylinder(durchmesser:double; genauigkeit: integer; hoehe: double);
- var
- i, tic,steps : integer;
- half1, half2 : double;
- begin
- tic := 360 div genauigkeit;
- steps := 360 div tic;
- half1 := durchmesser/2;
- half2 := hoehe/2;
- glbegin(gl_quads);
- for i := 0 to tic do
- begin
- glvertex3f(sin(degtorad(i*steps))*half1, half2, cos(degtorad(i*steps))*half1);
- glvertex3f(sin(degtorad((i+1)*steps))*half1, half2, cos(degtorad((i+1)*steps))*half1);
- glvertex3f(sin(degtorad((i+1)*steps))*half1, -half2, cos(degtorad((i+1)*steps))*half1);
- glvertex3f(sin(degtorad(i*steps))*half1, -half2, cos(degtorad(i*steps))*half1);
- end;
- glend;
- glbegin(gl_polygon);
- for i := 0 to tic do
- begin
- glvertex3f(sin(degtorad(i*steps))*half1, half2, cos(degtorad(i*steps))*half1);
- end;
- glend;
- glbegin(gl_polygon);
- for i := 0 to tic do
- begin
- glvertex3f(sin(degtorad(i*steps))*half1, -half2, cos(degtorad(i*steps))*half1);
- end;
- glend;
- end;