I’m trying to make a simple, 4 sided plane. Here’s the code for the vertex positions, indices, and normals:
[java]
Vector3f[] vertices = {
new Vector3f(width / -2.0F, 0, height / -2.0F),
new Vector3f(width / 2.0F, 0, height / -2.0F),
new Vector3f(width / -2.0F, 0, height / 2.0F),
new Vector3f(width / 2.0F, 0, height / 2.0F)
};
int[] indices = {
0, 1, 2,
2, 3, 1
};
float[] normals = {
0, faceUp ? 1 : -1, 0,
0, faceUp ? 1 : -1, 0,
0, faceUp ? 1 : -1, 0,
0, faceUp ? 1 : -1, 0
};
Vector2f[] texCoords = {
new Vector2f(0, 0),
new Vector2f(0, 1),
new Vector2f(1, 0),
new Vector2f(1, 1)
};
[/java]
But for some reason, it’s not rendering right. Even with a light pointing straight on it, from both sides, it’s just shading solid black. I’ve tried with a directional light pointing right at it, and a point light just above it. Neither one worked. Any help?