Статья: OpenGL и Delphi на практике

begin

t0:=-3;t1:=3;

dt:=0.06;

glBegin(GL_POLYGON);

while t0<=t1 do

begin

x:=a*sin(t0)*sin(t0)*sin(t0)*sin(t0)*cos(t0);

y:=a*abs(sin(t0)*cos(t0));

glVertex3F(x,y,r);

t0:=t0+dt;

end;

t0:=0;

x:=a*sin(t0)*sin(t0)*sin(t0)*sin(t0)*cos(t0);

y:=a*abs(sin(t0)*cos(t0));

if Normal then glNormal3f(x,y,-r) else glNormal3f(x,y,r);

glEnd;

end;

procedure TForm1.FormPaint(Sender: TObject);

var m,n:single;dm:Single;a:Single;df:Single;

begin

a:=25;

df:=10;

glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);

glColor(1.0,0.0,0.0,0.0);

glMaterialfv(GL_FRONT,GL_AMBIENT,@mat1_amb);

glMaterialfv(GL_FRONT,GL_DIFFUSE,@mat1_dif);

glMaterialfv(GL_FRONT,GL_SPECULAR,@mat1_spec);

glMaterialf(GL_FRONT,GL_SHININESS,mat1_shininess);

m:=-1;n:=1;dm:=0.5;

К-во Просмотров: 390
Бесплатно скачать Статья: OpenGL и Delphi на практике