Hi!
im reading data from an obj file
I understand everything about the OBJ format
but I dont understand how to pass the data to opengl
in the way that
for example:

f 1/1/1 3/2/3 4/3/4 2/4/2

thats the first face, vertices 1,3,4,2 are used
Thats ok, but how do I pass this to opengl?
using glvertex4f(1,3,4,2) ??? I made the cube with all the correct data and it was a mess!
So can anyone tell me how to use glvertex4f or should I use glvertex3f always? im using glbegin with Quads as well!

else how can i convert from quads to triangles so i can easly render with glvertex3f ? (if not help me please)

glVertexnf specifies a single vertex directly. The number refers to the number of coordinate axes you want to specify.

If you’re rendering a single QUAD, you need to specify 4 vertices, e.g.:

glVertex3f(-10,-10, 5);
glVertex3f( 10,-10, 5);
glVertex3f( 10, 10,-5);
glVertex3f(-10, 10,-5);
glEnd();

If OBJ specifies the vertices and then links quads by vertex index, then vertex arrays combined with glDrawElements would be a good way to improve performance.

thanks
i think i got it now im using arrays on a forbidden language so it will be pretty hard to know which data goes where

but what happens when you have some faces that are quads and some others that are triangles?? can i use gl_quads anyway?

You can easily treat triangles as if they were quads,
by collapsing two nodes. In other words, you repeat
the last third node as a fourth node to a quad. This
might introduce artifacts in the picture… As an
alternative, treat quads as two triangles, so that
you only specify triangles after all (I do that).

Also, you can build vertex array objects so that you
can specify the triangles once, and then basically
call lists of arrays for each of the objects. This
is what you do when you want performance out of the
hardware… Read the “red book” for more details
(VBOs, vertex arrays, etc).

Finally, there are certain things for which you can