Talk About Network

Google





Graphics > OpenGL 3D API > Point Cloud + g...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 4766 of 5061
Post > Topic >>

Point Cloud + gluTess help needed

by mikkel rev <mikkel@[EMAIL PROTECTED] > May 24, 2008 at 03:55 PM

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?
 




 2 Posts in Topic:
Point Cloud + gluTess help needed
mikkel rev <mikkel@[EM  2008-05-24 15:55:39 
Re: Point Cloud + gluTess help needed
fungus <openglMYSOCKS@  2008-05-24 23:41:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 15:26:29 PST 2009.