Weird looking shading

Good evening.

I’ve written an ASE loader, and I’m calculating the normal for each vertex, putting everything in a couple arrays suitable for glNormalPointer, glVertexPointer etc. I’m using shading right now and the shading looks really weird. I get no gray triangles, just black or white. As I rotate the world, the faces are ‘turned on’ when they are facing the lightsource, and turns black when faced the other way, but there is nothing in between. Help! :slight_smile:

Just a thought, are the normals normalised

Shouldn’t the normals already be calculated in your ASE file, I’ve built my own and normals are part of the file.

Example:

*MESH_NORMALS {
*MESH_FACENORMAL 0 -0.1408 -0.8397 0.5246
*MESH_VERTEXNORMAL 5 -0.2387 -0.1360 0.9615
*MESH_VERTEXNORMAL 159 -0.1184 -0.8830 0.4543
*MESH_VERTEXNORMAL 87 -0.1245 -0.8596 0.4956
*MESH_FACENORMAL 1 -0.1524 -0.7815 0.6050
*MESH_VERTEXNORMAL 87 -0.1245 -0.8596 0.4956
*MESH_VERTEXNORMAL 162 -0.2276 -0.3920 0.8914
*MESH_VERTEXNORMAL 5 -0.2387 -0.1360 0.9615
*MESH_FACENORMAL 2 -0.1004 -0.9195 0.3799
*MESH_VERTEXNORMAL 44 -0.0858 -0.9331 0.3492
*MESH_VERTEXNORMAL 160 -0.0863 -0.9260 0.3676
*MESH_VERTEXNORMAL 87 -0.1245 -0.8596 0.4956