Archived

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

Vlade0000

Plz help me with Milkshape model loading!!!

Recommended Posts

Vlade0000    122
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
iwaskia    122
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