# Find Faces

I’m new to OpenGL and computer graphics.
I have only the coordinates of the vertices of the 3D object.
How to build or find triangular polygons (faces), as well as the texture coordinates?

Then you may be out of luck. You need the topology, i.e. which vertices form each face.

There are techniques for guessing the topology from the other data, but they’re fairly complex, and how well they work depends upon the data.

The fact that you have texture coordinates as well as vertex coordinates suggests that the topology probably existed at some point (techniques which generate sets of points without any topology tend not to generate texture coordinates), so you’d be better off figuring out how to get it than trying to reconstruct it through guesswork.

As a last resort, the first approach to consider would probably be a Delaunay triangulation of the texture coordinates, discarding degenerate triangles (i.e. where the same vertex coordinates are used for more than one vertex).

GClements, I’m not sure if the OP has texture coordinates:

I have only the coordinates of the vertices of the 3D object.

To, the OP, once you have the good topology of your model, you can use different algorithms to generate the texture-coordinates. One way to do it is to unroll or unfold the mesh on a plane. A common algorithm can be found here.

[QUOTE=GClements;1284264]Then you may be out of luck. You need the topology, i.e. which vertices form each face.

There are techniques for guessing the topology from the other data, but they’re fairly complex, and how well they work depends upon the data.

The fact that you have texture coordinates as well as vertex coordinates suggests that the topology probably existed at some point (techniques which generate sets of points without any topology tend not to generate texture coordinates), so you’d be better off figuring out how to get it than trying to reconstruct it through guesswork.

As a last resort, the first approach to consider would probably be a Delaunay triangulation of the texture coordinates, discarding degenerate triangles (i.e. where the same vertex coordinates are used for more than one vertex).[/QUOTE]
I have a formula on which to build points. Helicoid rotation surface. Example:
X = 20 * Cos(Angle);
Y = 20 * Sin(Angle);
Z+=0.5;
Further I obtained at each iteration the vertices:
new Vector3(0.0f, 0.0f, Z);
new Vector3(X,Y,Z);
*but there are no polygons
How to see the result of this construction in opengl window?

If you cannot guess any polygons, then I believe that the most easier thing would be to draw points.

i need to build normals and make lighting.
This can be done if the figure points to build?

You can. But lit points are not very useful, except if you have a very dense set of points in a little area.

See this in order to have your polygons.

[QUOTE=Sergio007;1284275]I have a formula on which to build points. Helicoid rotation surface. Example:
X = 20 * Cos(Angle);
Y = 20 * Sin(Angle);
Z+=0.5;
Further I obtained at each iteration the vertices:
new Vector3(0.0f, 0.0f, Z);
new Vector3(X,Y,Z);
but there are no polygons
How to see the result of this construction in opengl window?[/QUOTE]
In which case, the topology is simply a strip of quadrilaterals, i.e. each step adds 2 vertices with indices 2
n and 2n+1, and each step after the first adds 2 triangles whose vertex indices are [2n-2, 2n-1, 2n] and [2n, 2n-1, 2*n+1].

But in this specific case, you could just use glDrawArrays(GL_TRIANGLE_STRIP).

[QUOTE=GClements;1284284]In which case, the topology is simply a strip of quadrilaterals, i.e. each step adds 2 vertices with indices 2n and 2n+1, and each step after the first adds 2 triangles whose vertex indices are [2n-2, 2n-1, 2n] and [2n, 2n-1, 2n+1].

But in this specific case, you could just use glDrawArrays(GL_TRIANGLE_STRIP).[/QUOTE]
glDrawArrays(GL_TRIANGLE_STRIP) - this really works!)

This work too)