122 for (
int i=-10; i<10; ++i)
124 for (
int j=-10; j<10; ++j)
128 glColor4f(0.1,0.1,0.1,alpha);
132 glColor4f(0.6,0.6,0.6,alpha);
135 glVertex3f(i*40,0,j*40);
136 glVertex3f(i*40,0,(j+1)*40);
137 glVertex3f((i+1)*40,0,(j+1)*40);
138 glVertex3f((i+1)*40,0,j*40);
161 GLfloat position0[]={0.0,80.0,100.0,1.0};
162 GLfloat ambient0[]={0.2,0.2,0.2,1.0};
166 GLfloat position1[]={0.0,80.0,-100.0,1.0};
167 GLfloat ambient1[]={0.2,0.2,0.2,1.0};
168 GLfloat diffuse1[]={0.5,0.5,0.5,1.0};
169 GLfloat specular1[]={1.0,1.0,1.0,1.0};
171 glViewport(0,0,width(),height());
174 glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
176 glLightfv(GL_LIGHT0,GL_AMBIENT,ambient0);
180 glLightfv(GL_LIGHT1,GL_AMBIENT,ambient1);
181 glLightfv(GL_LIGHT1,GL_DIFFUSE,diffuse1);
182 glLightfv(GL_LIGHT1,GL_SPECULAR,specular1);
184 glEnable(GL_NORMALIZE);
185 glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
188 glMatrixMode(GL_PROJECTION);
192 glLightfv(GL_LIGHT0,GL_POSITION,position0);
193 glLightfv(GL_LIGHT1,GL_POSITION,position1);
206 GLfloat fogColor[4]={0.5,0.5,0.5,0.3};
208 glFogi(GL_FOG_MODE,fogMode);
209 glFogfv(GL_FOG_COLOR,fogColor);
210 glFogf(GL_FOG_DENSITY,0.005);
211 glHint(GL_FOG_HINT,GL_DONT_CARE);
212 glFogf(GL_FOG_START,200.0);
213 glFogf(GL_FOG_END,2000.0);
219 glClearColor(0.5,0.5,0.5,0.3);
220 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
221 glDisable(GL_LIGHTING);
222 glEnable(GL_DEPTH_TEST);
223 glEnable(GL_COLOR_MATERIAL);
224 glShadeModel(GL_FLAT);
225 glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
233 glRotated(-90.0,1.0,0.0,0.0);
234 glRotated( 90.0,0.0,0.0,1.0);