Error Help : Convert Parameter

Below is something about my code. I cant solve the error… Hope to get help from you all… Thanks… :slight_smile:
[b]
[b]#define GridSize 63

struct TGLCoord
{
float x,y,z;
};
TGLCoord Vertex [GridSize];
TGLCoord Normals [GridSize];

for (j=0;j<GridSize-1;j++)
{
   glBegin(GL_QUAD_STRIP);
   for (i=0;i<GridSize;i++)
{
          glNormal3fv(&Normals[i, j+1]);
              glVertex3fv(&Vertex[i, j+1]);
              glNormal3fv(&Normals[i, j]);
              glVertex3fv(&Vertex[i, j]);	
	}
   glEnd();
}[/b]

error C2664: ‘glNormal3fv’ : cannot convert parameter 1 from ‘TGLCoord *’ to ‘const GLfloat *’

In which language you are programing ? If you are programming in C then &Normal[i].x should be okay. Remark: You define a 1D array TGLCoord Normals [GridSize]; and try to access it like a 2D array => Normals[i, j+1]. I think this is valid in C# but in C you must write Normals[i][j+1]. So try something like this :


#define GridSize 63

struct TGLCoord
{
float x,y,z;
};
TGLCoord Vertex [GridSize][GridSize];
TGLCoord Normals [GridSize][GridSize];

for (j=0;j<(GridSize-1);j++)
{
glBegin(GL_QUAD_STRIP);
for (i=0;i<GridSize;i++)
{
glNormal3fv(&(Normals[i][j+1].x));
glVertex3fv(&(Vertex[i][j+1].x));
glNormal3fv(&(Normals[i][j].x));
glVertex3fv(&(Vertex[i][j].x));
}
glEnd();
}


Here I suppose a grid of 63x63.

Firstly, thanks for trinitrotoluene replied…
My language here is C++… Is it same as the solution for language C??

My language here is C++… Is it same as the solution for language C??
Yes.

Ok… I try now… Thanks for your suggestion… I will come back if got any error and don’t understand… Again, thanks for trinitrotoluene… You are smart…

trinitrotoluene, it works now… really thanks a lot for your help… touch

hey, even it works now, but still nothing to appear/show in GL_QUAD_STRIP? i had try to change it become a triangle (GL_TRIANGLES), and it is appears. Can anyone let me know why. Thanks…