Yaga-Shura
07-04-2007 08:51:04
Hi Guys,
I think, it's a silly question, but I can't find the answer anywhere.
I'm using MAX 9 and VS 8.0.
I downloaded a .3ds file out of the internet. I import it into MAX. The object consists out of many editable meshs with diffrent materials on them. I select one mesh and attach all other meshs to it. Then I export the single mesh. oFusion creates a .mesh file, which is ok. It also creates a material file like this:
In my C++ Code, I load the object:
My question is: How do i attach the material to it? If i try
So how do I have to attach the material?
I think, it's a silly question, but I can't find the answer anywhere.
I'm using MAX 9 and VS 8.0.
I downloaded a .3ds file out of the internet. I import it into MAX. The object consists out of many editable meshs with diffrent materials on them. I select one mesh and attach all other meshs to it. Then I export the single mesh. oFusion creates a .mesh file, which is ok. It also creates a material file like this:
material Material_#818/Material_#1
{
technique
{
pass
{
ambient 0.690196 0.690196 0.690196 1
diffuse 0.690196 0.690196 0.690196 1
specular 1 1 1 1 27
}
}
}
material Material_#818/dark_hull
{
technique
{
pass
{
ambient 0 0 0 1
specular 1 1 1 1 27
alpha_rejection greater 128
texture_unit
{
texture_alias 0
texture HULLMAP.BMP
scale 2 10
}
}
}
}
material Material_#818/hull
{
technique
{
pass
{
ambient 0 0 0 1
specular 1 1 1 1 27
alpha_rejection greater 128
texture_unit
{
texture_alias 0
texture HULLMAP.BMP
scale 2 10
}
}
}
}
material Material_#818/engine
{
technique
{
pass
{
ambient 0.172549 0.172549 0.188235 1
diffuse 0.172549 0.172549 0.188235 1
specular 0.278392 0.278392 0.278392 1 24
}
}
}
material Material_#818/Material_#2
{
technique
{
pass
{
ambient 0.0313726 0.0117647 0 1
diffuse 0.0313726 0.0117647 0 1
specular 1 1 1 1 38
}
}
}
In my C++ Code, I load the object:
createEntity( "Player", "models\\Cylinder04.mesh" );
My question is: How do i attach the material to it? If i try
setMaterialName("#818");
or setMaterialName("_#818");
, the Ogre.log tells me, that Ogre can't find the material.So how do I have to attach the material?