Archived

This topic is now archived and is closed to further replies.

Plz help me with Milkshape model loading!!!

This topic is 5703 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there i have problems reading the materials from the file here is how i do it //read number of materials fread(&numMaterials, sizeof(ushort), 1, file); pMaterials = new MS3DMaterial[numMaterials]; //read materials for(i = 0; i < numMaterials; i++) { fread( pMaterials.name, sizeof(char), 32, file); fread( pMaterials[i].ambient, sizeof(float), 4, file); fread( pMaterials[i].diffuse, sizeof(float), 4, file); fread( pMaterials[i].specular, sizeof(float), 4, file); fread( pMaterials[i].emissive, sizeof(float), 4, file); fread(&pMaterials[i].shininess, sizeof(float), 1, file); fread(&pMaterials[i].transparency, sizeof(float), 1, file); fread(&pMaterials[i].mode, sizeof(char), 1, file); fread( pMaterials[i].textureFileName, sizeof(char), 128, file); fread( pMaterials[i].textureAlphamap, sizeof(char), 128, file); logmsg(pMaterials[i].textureFileName); //ms3d 1.5x relative path if(strncmp(pMaterials[i].textureFileName, ".\\", 2) == 0) { strcpy(pathTemp + pathLength, pMaterials[i].textureFileName + 1); strcpy(pMaterials[i].textureFileName, pathTemp); } } //-------- now my texture loader saiz that it can''t find the textures and this is what my texture loader reads $øwøT÷wÿÿÿ\heart.tga -- texture file name of material no: 1 -- wrong no texture -- and the the second material doesn''t load -- which is also wrong now i know the model only has 2 materials... i whent and checked in the milkshape editor the rest of my model loads perfectly, only when reading the materials is a problem any ideas

Share this post


Link to post
Share on other sites
are you sure your pathTemp is correct?
seem works,

ok i thought u missed i, forum problem
[i]

[edited by - iwaskia on May 3, 2002 11:28:29 AM]

Share this post


Link to post
Share on other sites