• Advertisement
Sign in to follow this  

change cloth

This topic is 4322 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 have a hero, I want to change his cloth at run time. I think 2 solution: 1. just change material/texture. quesion: if export mesh from 3dmax by pandle and then load .x ,I only can load a mesh per a material/texture. how to load mutliple material/texture? I do this way,first load a mesh and material/texture normal.and then I create other material/texture in 3dmax,and them export it as a seperated .x file call xxxmaterial.x(xxx = mesh that have the material/texture) and load the .x and then get the material/texture ,put it to mesh class(that have multiple material/texture object defined) it seem to be a little unconvenient. any better way are very welcome. 2. change mesh. I define a hero class ,that have many mesh reference,and have a current mesh id. if I change a cloth, I just set cloth id that I need. renderer code just render mesh that current id point to. class hero { vector<Mesh*> meshcloth; Mesh * myBody; int mycurrentWearClothId; Mesh* getCloth(int id) {return meshcloth[id]) render() {mybody->submit(); getCloth()->submit()} } any better idea? thanks

Share this post


Link to post
Share on other sites
Advertisement
If you could do it somehow with (1), that would be a lot better. Remember that since you need to manage the textures yourself, this should be pretty easy. Just identify the material that is your character's cloth, and change its texture when needed.

(2) is bad because you are duplicating all of that geometry for no reason.

Share this post


Link to post
Share on other sites
Each set of clothes in MAX would be a single image. You could just load this separately from the mesh (using D3DXCreateTextureFromFile, for example). You'd have to know which textures to load from the mesh, which you could hard code or use some ini file for. That'd replace the material handling normally done for the mesh.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement