Skip to main content
GameDev.net gamedev.net
🔒 Locked

change cloth

Started by derek7 Apr 21, 2006 at 11:01 AM 1 replies 700+ views
Original Post
derek7
derek7
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 meshcloth; Mesh * myBody; int mycurrentWearClothId; Mesh* getCloth(int id) {return meshcloth[id]) render() {mybody->submit(); getCloth()->submit()} } any better idea? thanks
circlesoft
circlesoft
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.
ET3D
ET3D
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.