Hi,
I am a beginner in opengl. I’ve got the following problem:
I draw a object, which has 600 vertices, 1100 triangles.
I apply a bmp as its texture. But the rendering process is very slow,
round about 90ms. Result has been obtained on a Pentium3 800Mhz with
128Mb memory and a ATI video card(16Mb video memory). So in animation,
frame per second is not more than 10. I don’t use the display lists as
the vertices are subject to modifications. Can anyone help me? Give me some
advice,anything is ok! The following is my code.
glBindTexture(GL_TEXTURE_2D, m_uTex);
for(i=0;i<count;i++){ //count is 1100
ai = pFacetList->facet[i].point[0];//pFacetList : all the triangles
bi = pFacetList->facet[i].point[1];
ci = pFacetList->facet[i].point[2];
a=&pVertexList->vertex[ai];//pVertexList : all the vertices
b=&pVertexList->vertex[bi];
c=&pVertexList->vertex[ci];
glBegin(GL_TRIANGLES);
glTexCoord2fv(m_pTex[ai]);//texture coordinate
glNormal3f(a->normalx, a->normaly, a->normalz);
glVertex3f(a->x, a->y, a->z);
glTexCoord2fv(m_pTex[bi]);
glNormal3f(b->normalx, b->normaly, b->normalz);
glVertex3f(b->x, b->y, b->z);
glTexCoord2fv(m_pTex[ci]);
glNormal3f(c->normalx, c->normaly, c->normalz);
glVertex3f(c->x, c->y, c->z);
glEnd();
}
And texture environment:
glShadeModel(GL_SMOOTH);
glEnable(GL_TEXTURE_2D);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
Regards.
[This message has been edited by kwwang (edited 04-27-2001).]