how to highlight part of mesh?
Posted: Fri Jan 07, 2011 10:19 pm
Hi,
I have a model that I created in milkshape that has 3 groups. I export the model as a DirectX .x file format and load it using irrlicht.
All of the groups are loaded as Joints which is great. I applied a shader to the entire mesh just to test and it worked great. Now what I want to do is get one of the joint nodes and apply a shader only to that joint. So I tried the following:
The tank node is retrieved successfully, but when I try to apply my shader to the tank joint node it fails because it says my tank scenenode has a material count of 0. I used separate textures for each group in my model so I am not sure why it is saying that the material count is 0 for my joint nodes.
Is it possible to apply a shader to a joint node? Or should I be trying a different approach to highlight only portions of a model?
Thanks
I have a model that I created in milkshape that has 3 groups. I export the model as a DirectX .x file format and load it using irrlicht.
All of the groups are loaded as Joints which is great. I applied a shader to the entire mesh just to test and it worked great. Now what I want to do is get one of the joint nodes and apply a shader only to that joint. So I tried the following:
Code: Select all
IAnimatedMesh* mesh = smgr->getMesh("../../media/test.x");
IAnimatedMeshSceneNode* mynode = smgr->addAnimatedMeshSceneNode( mesh );
ISkinnedMesh* smesh = static_cast<irr::scene::ISkinnedMesh*>(mesh);
ISceneNode* tank = mynode->getJointNode("tanks");
if(tank)
{
tank->setMaterialFlag(EMF_LIGHTING, false);
tank->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType2);
}
Is it possible to apply a shader to a joint node? Or should I be trying a different approach to highlight only portions of a model?
Thanks