32 #include <Gui/SimpleGLApp.hh>
33 #include <Gui/SceneGL.hh>
37 GLfloat light_position0[] = {1.0f, 1.0, 3.0f, 1.0f};
46 BIASASSERT(this->pc!=NULL);
51 glClearColor(0.2,0,0,0);
52 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
57 this->pc->DisplayCameraView();
62 this->pc->DisplayCoordCross();
66 glTranslatef(0, 0. ,-1.);
68 glColor4f( 0.9f, 0.2f, 0.5f, 1.0f );
77 case 1: glutSolidSphere(1,20,20);
break;
78 case 2: glutSolidCube(1);
break;
79 case 3: glutSolidCone(1, 1, 20, 20);
break;
86 glTranslatef(light_position0[0], light_position0[1], light_position0[2] );
88 glDisable(GL_LIGHTING);
89 glutSolidSphere(0.2,32,32);
100 MyApp() : SimpleGLApp(){
101 this->scene =
new MyScene();
112 GLfloat light_maincolor0[] = {1.0f, 1.0, 1.0f, 1.0f};
113 GLfloat light_ambientcolor0[] = {0.4f, 0.2f, 0.2f, 1.0f};
116 glLightfv(GL_LIGHT0, GL_POSITION, light_position0);
117 glLightfv(GL_LIGHT0, GL_DIFFUSE, light_maincolor0);
118 glLightfv(GL_LIGHT0, GL_SPECULAR, light_maincolor0);
119 glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambientcolor0);
122 glEnable(GL_LIGHTING);
123 glEnable(GL_DEPTH_TEST);
126 GLfloat paintcolor0[] = { 0.9f, 0.2f, 0.5f, 1.0f};
127 GLfloat specularcolor0[] = { 1.0f, 1.0f, 1.0f, 1.0f};
128 GLfloat shininess0[] = { 70.0f };
131 glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, specularcolor0);
132 glMaterialfv( GL_FRONT_AND_BACK, GL_SHININESS, shininess0);
133 glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, paintcolor0);
135 glColor4fv(&paintcolor0[0]);
Simple interface for GL calls.
virtual void Display()=0
main interface
static int mode
(global) params for simple user interaction with client Display routine