|
//--------------------------------------------------------------------------- |
//--------------------------------------------------------------------------- |
#pragma package(smart_init) |
float x1,x2,y,ax,ay,dx,rx1,rx2; |
GLfloat pos[]={200.0f,200.0f,-200.0f}; |
GLfloat specular[]={1.0f,1.0f,1.0f,1.0f}; |
GLfloat specref[]={1.0f,1.0f,1.0f,1.0f}; |
GLfloat ambient[]={0.3,0.3,0.3,1.0}; |
GLfloat diffuse[]={0.3,0.3,0.3,1.0}; |
GLfloat pos1[]={-200.0f,-100.0f,-200.0f}; |
GLfloat specular1[]={1.0f,1.0f,1.0f,1.0f}; |
GLfloat ambient1[]={0.1,0.1,0.1,1.0}; |
GLfloat diffuse1[]={0.1,0.1,0.1,1.0}; |
//--------------------------------------------------------------------------- |
__fastcall TForm1::TForm1(TComponent* Owner) |
Application->OnIdle=IdleLoop; |
//--------------------------------------------------------------------------- |
void __fastcall TForm1::IdleLoop(TObject *,bool &done) |
//--------------------------------------------------------------------------- |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
rx1=(-x1+ax); if (rx1>dx) rx1=dx; |
//------------------------- |
glNewList(eye,GL_COMPILE); |
glColor3f(0.8f,0.8f,0.8f); |
gluSphere(Sphere,46,48,48); |
glColor3f(0.0f,0.0f,0.0f); |
gluSphere(Sphere,10,20,20); |
glColor4f((float)color[0]/255.0f,(float)color[1]/255.0f,(float)color[2]/255.0f,0.5f); |
gluSphere(Sphere,24,32,32); |
//--------------------------------------------------------------------------- | |