Steff wrote: [...] > I am playing with OpenGL and especially light in OpenGL. I have tried > to set light in the GLSurfaceView application in ApiDemos (Under > Graphics / OpenGL ES). [...] > gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); > gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
By the looks of it, you aren't supplying normals. In order to make the lighting work you'll need to give a normal vector for every vertex in your shape. (So, if you want flat shading, each vertex of a triangle should have the same normal vector.) Yeah, this got me, as well. I eventually wrote my own routines to construct display lists from descriptions of polygons, calculating the normals automatically as it did so. Here's a good reference, complete with normal calculation code. You'll need to convert it from C to Java, but that's pretty easy: http://www.falloutsoftware.com/tutorials/gl/gl8.htm -- David Given [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

