public void onDrawFrame(GL10 gl) { // Clears the screen and depth buffer. gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glLoadIdentity(); camera1.look(); fog.draw(gl); switch ((setLights / 10) % 3) { case 0: light4.disable(); light0.enable(); light3.enable(); light0.setPosition(); light3.setPosition(); break; case 1: light0.disable(); light3.enable(); light4.enable(); light3.setPosition(); light4.setPosition(); break; case 2: light3.disable(); light0.enable(); light4.enable(); light0.setPosition(); light4.setPosition(); break; default: break; } setLights++; gl.glColor4f(0.0f, 1.0f, 0.0f, 0.0f); gl.glPushMatrix(); gl.glRotatef(-90.0f - angle, 0.0f, 1.0f, 0.0f); winter.draw(gl); light1.setPosition(); light2.setPosition(); gl.glTranslatef(-7.0f, 20.0f, 0.0f); sphere.draw(gl); gl.glPopMatrix(); gl.glPushMatrix(); particles.draw(gl); gl.glPopMatrix(); }
// draw solids of a scene public void drawScene(String drawType) { PA4.clearPixelBuffer(); for (int i = 0; i < solids.size(); i++) { Object3D obj = solids.get(i); obj.draw(lights, view_vector, drawType); } }