Archived

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

Loading MilkShape files

This topic is 6110 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

I read NeHe''s OpenGL tutorials and learnt how to load MilkShape models. But if I''m now copying the .ms3d files into another path, the path for the textures doesn''t change. So the textures are searched again in the old folder and can''t be found. Does anybody know a solution for this problem?

Share this post


Link to post
Share on other sites
No problem. I had this problem, and how I fixed it was, after you have moved the milkshape model, go back into the milkshape program, and update the location of all the texture files. It should work then. It worked for me.

The Kid

I don''''t know what the future holds, but I know who holds the future.

Share this post


Link to post
Share on other sites
Include string.

#include
using namespace std;

Then in the function that loads the images, just strip off the folder info by:

1) Initializing the string to be the filename of the texture
2) Searching the string for the last slash
3) Re-initializing te string to be the substring of the string that is just the file itself without the folder info
4) Set the char* filename = to the string

If you can''t figure that out, NeHe''s portalib thing has a utility for it

Share this post


Link to post
Share on other sites