GAmEtuT.. 3ds+texture=trouble
Hallo guys, i need help with gametut.. 3ds loader
i cant load material for more that one model !!! and i dont get why ! what the hell i did wrond again ????
//////////////////////////////////////////////////////////////
//// my texture loader
void TexModel(t3DModel pModel, int i)
{
static int ct;
for(int jods = 0; jods < pModel.numOfMaterials; jods++)
{
if(strlen(pModel.pMaterials[jods].strFile) > 0)
{
CreateTexture(ds_Texture, pModel.pMaterials[jods].strFile, jods+ct);
}
pModel.pMaterials[jods].texureId = jods+ct;
if(strlen(pModel.pMaterials[jods].strFile) > 0)
{
ct++;
}
}
}
////////////////////////////////////////////////////////
///////Add Texture////////////////////////////////////
if(pObject->bHasTexture) {
glEnable(GL_TEXTURE_2D);
//glColor3ub(255, 255, 255);
if(result!=5){glBindTexture(GL_TEXTURE_2D, ds_Texture[(pModel.pMaterials[pObject->materialID].texureId)]);}
} else {
glDisable(GL_TEXTURE_2D);
//glColor3ub(255, 255, 255);
}
////////////////////////////////////////////////////////
aug_h_Load3ds.Import3DS(&aug_h_model, "models/w_aug.3ds");
TexModel(aug_h_model, 0);
pl_model_Load3ds.Import3DS(&pl_model, "models/terrorx.3ds");
TexModel(pl_model, 0);
[edited by - Wickeeed on November 12, 2003 7:54:07 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement