Original Post
Hi all. A real question this time: I have a class which stores some arrays, providing my program with vertex points and polygon information (which 3 vertices to use for 1 polygon) Each model-mesh currently is created holding a dummy model, a simple pyramid. The uncommented code works. But the commented code results in compiler errors. Can someone explain to me what is wrong with it, or why it can't be done? Tnx in advance
register int i;
for(i = 0; i < test->GetModelMeshPtr()->i_PolygonCount; i++)
{
//glVertex3f(test->GetModelMeshPtr()->Vertices[test->GetModelMeshPtr()->Polygons.x].x, test->GetModelMeshPtr()->Vertices[test->GetModelMeshPtr()->Polygons.x].y, test->GetModelMeshPtr()->Vertices[test->GetModelMeshPtr()->Polygons.x].z);
//glVertex3f(test->GetModelMeshPtr()->Vertices[test->GetModelMeshPtr()->Polygons.y].x, test->GetModelMeshPtr()->Vertices[test->GetModelMeshPtr()->Polygons.y].y, test->GetModelMeshPtr()->Vertices[test->GetModelMeshPtr()->Polygons.y].z);
//glVertex3f(test->GetModelMeshPtr()->Vertices[test->GetModelMeshPtr()->Polygons.z].x, test->GetModelMeshPtr()->Vertices[test->GetModelMeshPtr()->Polygons.z].y, test->GetModelMeshPtr()->Vertices[test->GetModelMeshPtr()->Polygons.z].z);
int v = test->GetModelMeshPtr()->Polygons.x;
glVertex3f(test->GetModelMeshPtr()->Vertices[v].x, test->GetModelMeshPtr()->Vertices[v].y, test->GetModelMeshPtr()->Vertices[v].z);
v = test->GetModelMeshPtr()->Polygons.y;
glVertex3f(test->GetModelMeshPtr()->Vertices[v].x, test->GetModelMeshPtr()->Vertices[v].y, test->GetModelMeshPtr()->Vertices[v].z);
v = test->GetModelMeshPtr()->Polygons.z;
glVertex3f(test->GetModelMeshPtr()->Vertices[v].x, test->GetModelMeshPtr()->Vertices[v].y, test->GetModelMeshPtr()->Vertices[v].z);
}