I'm pretty new to this forum and this is my first post. I'm trying to do a 3D scene with OpenGL ES and have a spinning mesh on the screen. I added a light that I would like to have fixed to light up the mesh. My problem is that the light keeps spinning with the mesh. Anyone know the secret to get fixed light soures?
My code kinda look like this:
Using java Syntax Highlighting
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
- gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lightAmbientBuffer);
- gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightDiffuseBuffer);
- gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPositionBuffer);
- gl.glEnable(GL10.GL_LIGHT0);
- }
- public void onDrawFrame(GL10 gl) {
- gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); //
- gl.glLoadIdentity();
- gl.glPushMatrix();
- gl.glTranslatef(0, 0, -8f);
- gl.glRotatef(angle, 1, 1, 0);
- mesh.draw(gl);
- gl.glPopMatrix();
- angle += 3;
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4



