PDA

View Full Version : GL_Triangles



alexiis
12-21-2011, 07:27 AM
Hello, Dear community! I have a group of pixels (x,y,z). My mission is to draw my texture on that pixels. As i understand for doing this i must use GL_Triangles, but at this moment i have only pixels that are not combined in triangles. What i need to do to complete my mission? Thank You.

carsten neumann
12-21-2011, 07:55 AM
Extracting surfaces from point clouds can be done with the "marching cubes" algorithm and variations of it.
AFAIK you can also have OpenGL texture GL_POINTS if you enable texturing and assign texture coordinates to each vertex - of course that will not fill the areas between points only the points themselves will have a colour based on the texture.

alexiis
12-21-2011, 08:22 AM
Thank you

alexiis
12-21-2011, 09:21 AM
As i understand with "assign texture coordinates to each vertex" you mean:
glBegin (GL_POINTS);
glTexCoord2f (X, Y);
glVertex3f(X, Y, Z);
glEnd;
?

awhig
12-29-2011, 12:54 PM
If not information is provided, you may implement Delauny triangulation to get triangles. Of course you may have to pick a starting point.