0
votes

If I have cube whose edges are parallel to the axes and is centered at the origin, is it correct that the normals are parallel to the axes or in other words only one component in normal vector can be non-zero and the other two components must be zero? IF x,y,z, is normal vector then if x is not zero then y and z must be zero?

In OpenGL ES application how many normals are needed for proper lighting? Do We need one normal per vertex, or one normal per triangle or one normal per surface?

These 2 lines of code are related to this question:

gl.glEnableClientState(GL10.GL_NORMAL_ARRAY);
gl.glNormalPointer(GL10.GL_FLOAT, 0, mNormalBuffer);

How OpenGL ES knows which normal corresponds with which triangle, or vertex or surface of the mesh being drawn?

1

1 Answers

1
votes

Normals are specified per vertex and do not have to be parallel to an axis (although they will be in your cube's case), they must be of unit length and perpendicular to the surface that your mesh is approximating.

Check out this answer to a similar question.