getting submeshes by name

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
rogerdv
Posts: 93
Joined: Wed Aug 27, 2003 4:20 pm

getting submeshes by name

Post by rogerdv »

Is there some way to obtain and a submesh by name from a model (or node) and apply it a different texture than the rest of the model?
ru guo ni yao ai, ni jiang bu hui shi qu
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

Is this submesh a different mesh contained in a child node of the main node? Or is it a child in your 3d editor, exported to some file format in combination with the whole mesh?
rogerdv
Posts: 93
Joined: Wed Aug 27, 2003 4:20 pm

Post by rogerdv »

The idea is to have a geometry called "head" in the 3d editor, another called "body" and so on. In the game, get a submesh by that name and apply an specific material. I remember that in neoengine you can do that.
ru guo ni yao ai, ni jiang bu hui shi qu
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

Unfortunately in Irrlicht you can only apply one texture to a mesh (well, it supports multiple textures depending on the material type, but the second textures are for stuff like reflection maps, etc). To get what you want, you will have to put all the textures in one file, then apply UV mapping in your 3d editor.
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

UV mapping all of the pieces together will be better anyway, since it will ensure more efficient use of space in the skin (assuming you were individually skinning the others).
a screen cap is worth 0x100000 DWORDS
rogerdv
Posts: 93
Joined: Wed Aug 27, 2003 4:20 pm

Post by rogerdv »

Impossible. I have 4 races, with two genders each one. Supposing I have just a couple of different items (helmet/no helmet, armor/no armor, etc) that would require an incredible amount of skining work. I want to have only one "armor skin" that fits all possible races and so on for other items (helmets, gloves, etc).
ru guo ni yao ai, ni jiang bu hui shi qu
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

Could you make a seperate helmet mesh and add it as a child of the character object? In Irrlicht, not your 3d editor. So the helmet would be its own Scene Node.
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

Post by powerpop »

this is the problem i ran into (and which hopefully gets changed in a future release) - it seems the only way to do this in IRR is to make separate models for all the parts of your object - and then its one texture per model

niko, are you open to changing this in future releases? it is one of those niceties that many take for granted in their 3d engine - sometimes its good to have one UV mapped graphic and sometimes its much nicer to have separate textures applied (with or without UV) to a submesh

in my app i have block objects for things like trees and parts of buildings - usually these have two or three submeshes with different textures - and my end users can change the textures individually on the fly - so you can see it would be easier for me to make one mesh with submeshes and textures rather than try to require my users to make a UV mapped graphic or break my models into many smaller models
Post Reply