hi
I have a array of points positions like this:
GLdouble buha1[32424][3]={129,269,254,
130,263,135,
130,264,111,
130,265,81,
130,268,213,
130,269,254,
131,245,186,
131,256,254,
131,257,252,
131,258,252,
131,259,243,
131,260,145,
131,261,106,
131,262,186
....
....
I want to turn those points into a polygon mesh so I do this:
GLUtesselator *tessObj;
GLuint modelList;
void CALLBACK beginCallback(GLenum mode)
{
glBegin(mode);
}
void CALLBACK endCallback()
{
glEnd();
}
void CALLBACK vertexCallback(GLvoid* vertex)
{
}
//in the initialiation methode:
tessObj = gluNewTess();
gluTessCallback(tessObj, GLU_TESS_BEGIN,(void) beginCallback);
gluTessCallback(tessObj, GLU_TESS_END, (void)endCallback);
gluTessCallback(tessObj, GLU_TESS_VERTEX,(void) vertexCallback);
/* the callback routines registered by gluTessCallback() */
modelList = glGenLists(1);
glNewList(modelList,GL_COMPILE);
gluTessBeginPolygon(tessObj, NULL);
gluTessBeginContour(tessObj);
for (int i=0; i<32424;i++)
{
GLdouble p1[3];
p1[0]=buha1[i][0]/100;
p1[1]=buha1[i][1]/100;
p1[2]=buha1[i][2]/500;
gluTessVertex(tessObj, p1, p1);
}
gluTessEndContour(tessObj);
gluTessEndPolygon(tessObj);
glEndList();
//And in the draw methode
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glTranslatef(movex,movey,movez);
glRotatef(rotfact,rotx,roty,rotz);
glCallList(modelList);
it compiles just fine, but nothing renders on the screen, all I get is a
black window. what do I do wrong?


|