[glVertex3v & glnormal3fv equivalents ?]

Hello everyone !

I am developping a 3D application with OpenGL ES by adapting
some OpenGL code to OpenGL ES.

Since these two functions doesn’t exist on ES, i tried to
recode them but in vain… :frowning:

Here’s how it goes :

OpenGL code :

for (int i = 0; i < 3; ++i)

Here’s my code :

I tried to do like this (assuming the necessited states are active…)

void my_glnormal3fv(float *v)
glNormal3f(v[0], v[1], v[2]);

void my_glvertex3fv(float *v)
glVertexPointer(3, GL_FLOAT, 0, v);
glDrawArrays(GL_TRIANGLE, 0, 3);

I get odd drawing (but almost the same as the original code,
but some vertices are just not good)

Do you have a better solution ?

Thanks in advance.

PS : Sorry for the bad english, i’m french :wink:

The glVertex3fv specifies single vertex within the triangle while the glDrawArrays specifies entire triangle. Because of this, the my_glvertex3fv does something entirely different than the original glVertex. Depending on how you store the normals and positions, you might need to construct vertex arrays describing entire triangle similar to one described in here

Ok i can see now how i should proceed.

Thanks a lot !

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.