I've never done anything in OpenGL. But referring to
MSDN[
^], I suggest
float[] points = {
1.0F, 0.0F, 0.5F,
1.0F, 1.0F,
1.0F, 1.0F, 1.0F
};
glNormal3f(points[0], points[1], points[2]);
glTexCoord2f(points[3], points[4]);
glVertex3f(points[5], points[6], points[7]);
points
is an array. You can access its elements using the correct index in square brackets. Be careful not to use a non-existent index for it will result in an exception.
Have you considered to use a custom object with more descriptive naming for the floats? (I don't know the performance penalty, though). It could read something like that:
class TriangleCoordinages
{
public float NormalX, NormalY, NormalZ;
public float TextureX, TextureY;
public float LocationX, LocationY, LocationZ;
public TriangleCoordinates(
float normalX, float normalY, float normalZ,
float textureX, float textureY,
float locationX, float locationY, float locationZ
){
NormalX = normalX;
NormalY = normalY;
NormalZ = normalZ;
TextureX = textureX;
TextureY = textureY;
LocationX = locationX;
LocationY = locationY;
LocationZ = locationZ;
}
}
TriangleCoordinates triangle = new TriangleCoordinates(
1.0F, 0.0F, 0.5F,
1.0F, 1.0F,
1.0F, 1.0F, 1.0F
);
glNormal3f(triangle.NormalX, triangle.NormalY, triangle.NormalZ);
glTexCoord2f(triangle.TextureX, triangle.TextureY);
glVertex3f(triangle.LocationX, triangle.LocationY, triangle.LocationZ);