PDA

View Full Version : glDrawArrays problem



Min
02-17-2005, 04:51 PM
hi.

I'm working with QNX momentics 6.3.0 development suit.

I compiled my code in ppc(big endian) version and executed in my car-navigation hardware.

The problem is about glDrawArrays.

here is my code.

glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

for(i=0;i<pb->buildingHeader->numOfObj;i++){
glVertexPointer(3,GL_FLOAT,0,pb->rawBuildingData+(pBaseObj+i)->vertexOff);
glNormalPointer(GL_FLOAT,0,pb->rawBuildingData+(pBaseObj+i)->normalOff);
glTexCoordPointer(2,GL_FLOAT,0,pb->rawBuildingData+(pBaseObj+i)->textureOff);
glBindTexture(GL_TEXTURE_2D,pb->textureIndices[(pBaseObj+i)->materialID]);
glDrawArrays(GL_TRIANGLES,0,(pBaseObj+i)->numOfVerts);
}

whenever (pBaseObj+i)->numOfVerts exceeds 60 (i.e. 20 triangles),only the texture appears in wrong place.

so I'm thinking there might be a buffer limitation in glDrawArrays or in glTexCoordPointer.

Or is this related to my graphic chip's memory? (it's about 64 Mb).

And the texture map I used is one piece of 128(width)*128(height)*24(bpp).

Any suggestions or advices would help.. thanks.

[ February 17, 2005: Message edited by: Min ]