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

begin

DrawElement(Sqrt(a-m*m),Sqrt(a-(m+dm)*(m+dm)),m/df,(m+dm)/df);

m:=m+dm;

end;

DrawFace(Sqrt(a-(m)*(m)),(m)/df,True);

m:=-1;

DrawFace(Sqrt(a-(m)*(m)),(m)/df,True);

end;

procedure TForm1.FormResize(Sender: TObject);

const lm:Array[0..3] of Single = (0.5,0.5,0.5,1.0);

const

light_ambient:array[0..3] of glfloat = (0.0,0.0,0.0,1.0);

light_diffuse:array[0..3] of glfloat = (1.0,1.0,1.0,1.0);

light_specular:array[0..3] of glfloat = (2.0,2.0,2.0,1.0);

light_position:array[0..3] of glfloat = (2.0,1.0,3.0,1.0);

light_emission:array[0..3] of glfloat = (1.0,1.0,1.0,1.0);

light_spotdirection:array[0..3] of glfloat = (1.0,1.0,1.0,1.0);

begin

wglMakeCurrent(0,0);

wglDeleteContext(RC);

ReleaseDC(H,DC);

DC:=GetDC(H);

SetDCPixelFormat(DC);

RC:=wglCreateContext(DC);

wglMakeCurrent(DC,RC);

glClearColor(0.6,0.6,0.6,0.0);

glMatrixMode(GL_PROJECTION);

glLoadIdentity;

glFrustum(-1,1,-1,1,2,20);

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