#include <Gui/SimpleGLApp.hh>
#include <Gui/SceneGL.hh>
GLfloat light_position0[] = {1.0f, 1.0, 3.0f, 1.0f};
void SetMaterial();
public:
BIASASSERT(this->pc!=NULL);
glClearColor(0.2,0,0,0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
this->pc->DisplayCameraView();
this->pc->DisplayCoordCross();
glPushMatrix();
glTranslatef(0, 0. ,-1.);
SetMaterial();
glColor4f( 0.9f, 0.2f, 0.5f, 1.0f );
switch(geoMode){
case 0:
glFrontFace(GL_CW);
glutSolidTeapot(1);
glFrontFace(GL_CCW);
break;
case 1: glutSolidSphere(1,20,20);break;
case 2: glutSolidCube(1); break;
case 3: glutSolidCone(1, 1, 20, 20); break;
}
glPopMatrix();
glPushMatrix();
glTranslatef(light_position0[0], light_position0[1], light_position0[2] );
glColor3f(1, 1, 0);
glDisable(GL_LIGHTING);
glutSolidSphere(0.2,32,32);
glPopMatrix();
}
};
public:
MyApp() : SimpleGLApp(){
this->scene = new MyScene();
}
};
IMPLEMENT_APP(MyApp)
void SetMaterial(){
GLfloat light_maincolor0[] = {1.0f, 1.0, 1.0f, 1.0f};
GLfloat light_ambientcolor0[] = {0.4f, 0.2f, 0.2f, 1.0f};
glLightfv(GL_LIGHT0, GL_POSITION, light_position0);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_maincolor0);
glLightfv(GL_LIGHT0, GL_SPECULAR, light_maincolor0);
glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambientcolor0);
glEnable(GL_LIGHT0);
glEnable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
GLfloat paintcolor0[] = { 0.9f, 0.2f, 0.5f, 1.0f};
GLfloat specularcolor0[] = { 1.0f, 1.0f, 1.0f, 1.0f};
GLfloat shininess0[] = { 70.0f };
glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, specularcolor0);
glMaterialfv( GL_FRONT_AND_BACK, GL_SHININESS, shininess0);
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, paintcolor0);
glColor4fv(&paintcolor0[0]);
}