Hi!
Could someone please help me rewrite this lines of code for OpenGL ES 1.0.
The problem with these lines of code is that OpenGL ES 1.0 does not support glTexCoord3f and glVertex3f, glBegin and glEnd.
What you can use is glVertexPointer and glTexPointer and glDrawElements.
Unfortunately I can’t figure out how to make them work.
I haven’t managed to get it working properly so please help.
Here is the code.
glBegin(GL_TRIANGLES);
currPtr = tDispObj->group[i].objTngls;
while (currPtr != NULL)
{
if (!currPtr->NormType)
glNormal3f(currPtr->faceNorm.x, currPtr->faceNorm.y, currPtr->faceNorm.z);
else
glNormal3f(tDispObj->objNorms[currPtr->n1].x, tDispObj->objNorms[currPtr->n1].y, tDispObj->objNorms[currPtr->n1].z);
if (currPtr->t1 > 0)
glTexCoord3f(tDispObj->objTexts[currPtr->t1].u, tDispObj->objTexts[currPtr->t1].v, tDispObj->objTexts[currPtr->t1].w);
glVertex3f(tDispObj->objVerts[currPtr->v1].x, tDispObj->objVerts[currPtr->v1].y, tDispObj->objVerts[currPtr->v1].z);
if (currPtr->NormType)
glNormal3f(tDispObj->objNorms[currPtr->n2].x, tDispObj->objNorms[currPtr->n2].y, tDispObj->objNorms[currPtr->n2].z);
if (currPtr->t2 > 0)
glTexCoord3f(tDispObj->objTexts[currPtr->t2].u, tDispObj->objTexts[currPtr->t2].v, tDispObj->objTexts[currPtr->t2].w);
glVertex3f(tDispObj->objVerts[currPtr->v2].x, tDispObj->objVerts[currPtr->v2].y, tDispObj->objVerts[currPtr->v2].z);
if (currPtr->NormType)
glNormal3f(tDispObj->objNorms[currPtr->n3].x, tDispObj->objNorms[currPtr->n3].y, tDispObj->objNorms[currPtr->n3].z);
if (currPtr->t3 > 0)
glTexCoord3f(tDispObj->objTexts[currPtr->t3].u, tDispObj->objTexts[currPtr->t3].v, tDispObj->objTexts[currPtr->t3].w);
glVertex3f(tDispObj->objVerts[currPtr->v3].x, tDispObj->objVerts[currPtr->v3].y, tDispObj->objVerts[currPtr->v3].z);
currPtr = currPtr->next;
}
glEnd();
Thanks