Archived

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

Daywalker313

Loading MilkShape files

Recommended Posts

Daywalker313    122
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
The Kid    122
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