Texturing problem
Now im using this code to render my bsp: tBSPFace *pFace = &sMBSP.BSPFace[faceIndex]; glBindTexture(GL_TEXTURE_2D, todas_texturas[pFace->textureID]); glBegin( GL_TRIANGLES ); for( int j=0; j < pFace->numMeshVerts; j++) { int offset = sMBSP.BSPMeshVerts[pFace->meshVertIndex+j].pMeshVerts + pFace->vertexIndex; glTexCoord2f(sMBSP.BSPVertex[offset].vTextureCoord.u, sMBSP.BSPVertex[offset].vTextureCoord.v); glVertex3f( sMBSP.BSPVertex[offset].vPosition.x, sMBSP.BSPVertex[offset].vPosition.y, sMBSP.BSPVertex[offset].vPosition.z); } glEnd(); I see the structure of the map (so the vertex are good). But i cant see the textures correctly (they are distorted). When i loaded textures i changeg the v coord to v = v * -1. I tested the textures in other triangles writting it manually and i can see it perfect. I compared the loaded coord with other bsp loaders that works, and the coords are the same. Can i asign textures to textcoord in this code in that way? Me estoy volviendo loco :-). Thanks.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement