View Full Version : GL_Triangles
12-21-2011, 06: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.
12-21-2011, 06: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.
12-21-2011, 07:22 AM
12-21-2011, 08:21 AM
As i understand with "assign texture coordinates to each vertex" you mean:
glTexCoord2f (X, Y);
glVertex3f(X, Y, Z);
12-29-2011, 11:54 AM
If not information is provided, you may implement Delauny triangulation to get triangles. Of course you may have to pick a starting point.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.