[LWJGL] Tetrahedron lighting problem

Hi
So I’m following a tutorial, and managed to make everything work, but when I try to write my own stuff of it, it is not quite so simple. I’m trying to render a lighted tetrahedron (so 4 points, 6 edges, 4 faces), without bottom face. All normals seem to be calculated properly, yet only the “front” face is lighted at all.


	public void setup(float x, float y, float z) throws Exception {
		setRoot(new Vector3f(x, y, z));
		radius = 0.15f;
		height = 0.7f;
		float r1 = radius;
		float r2 = radius * 0.8f;

		float[] positions = new float[] {
				// V0 - top
				0, height, 0,
				// V1 - left side
				-r1, 0, r2,
				// V2 - right side
				r1, 0, r2,
				// V3 - back
				0, 0, -r1,

		};
		float[] textCoords = new float[] {};
		int[] indices = new int[] { 3, 1, 0, 1, 2, 0, 2, 3, 0};
		// get normals, sadly...
		Vector3f V0 = new Vector3f(0, height, 0);
		Vector3f V1 = new Vector3f(-r1, 0, r2);
		Vector3f V2 = new Vector3f(r1, 0, r2);
		Vector3f V3 = new Vector3f(0, 0, -r1);

		Vector3f leftNormal = Tools.getNormal(V3, V1, V0);
		Vector3f frontNormal = Tools.getNormal(V1, V2, V0);
		Vector3f rightNormal = Tools.getNormal(V2, V3, V0);

		float[] normals = new float[] { leftNormal.x, leftNormal.y, leftNormal.z, frontNormal.x, frontNormal.y,
				frontNormal.z, rightNormal.x, rightNormal.y, rightNormal.z };
		mesh = new Mesh(positions, textCoords, normals, indices);
		Vector3f color = new Vector3f(0.1f, 0.7f, 0.1f);
		mesh.setMaterial(new Material(color, 0.5f));
	}

What I’m I doing wrong ? Perhaps I misunderstand the concept of indices ? The tutorial cubes render properly though.

I know that one can import .obj files, but than geometry cannot be generated through supplied parameters, right ?

EDIT: I have generalised this method, and I’ve found that it is the last declared faces that are not lighted. When the declared number of faces is even, than two faces are not lighted; and when odd number of faces is declared, than just the last one is not lighted. Any clues ?

If it helps someone, the problem was with the amount of coordinates passed to openGL, since for 3 faces there has to be 9 normals, since every point is lighted differently at each face.