Page 1 of 1

Problem loading Mesh.

Posted: Tue Mar 01, 2005 5:06 pm
by Lmlange
hi n00b here

I just started playing around with Ogre. and was going to load a mesh into the "Basic Tutorials", problem is that wh I place a material, in materials folder.....the model goes black? anyone got any ideas?

Also the convert(OgreMaya) into mesh, makes a 3rd file(XML) for faces.....where do i it that one?

mSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox");
mShip = mSceneMgr->createEntity("Elco", "Elco.mesh");
mShipNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
mShipNode->attachObject(mShip);

mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));

Posted: Tue Mar 01, 2005 6:55 pm
by haffax
And how does the material file look like? Did you define ambient / diffuse color to be 0 0 0 maybe? Are you sure material name in the file and material name in the Elco.mesh.xml match exactly?

Posted: Tue Mar 01, 2005 7:02 pm
by Lmlange
material Elco
{
technique
{
pass
{
ambient 0 0 0 1
diffuse 0.4 0.4 0.4 0.8
emissive 0.4 0.4 0.4 1
}
}
}
Elco.mesh.xml, not sure...i know where to place this one?

placed the Elco.Material in the ..materials\scripts and the Elco.mesh in the ..models...but where to place the XML?

Posted: Tue Mar 01, 2005 7:06 pm
by Lmlange
I also try add mShip->setMaterialName("Examples/Elco"); and placed it in the Example MAT-fil

Posted: Tue Mar 01, 2005 7:08 pm
by Lmlange
Maybe something im missing in the OgreMaya?

Posted: Tue Mar 01, 2005 7:14 pm
by jacmoe
Please, forget about the XML-file, it is used as input for converting the model to an OGRE mesh.
Try setting you ambient color to something else than black might help.
And take a look at Ogre.log for hints on missing textures, etc. :wink:

Posted: Tue Mar 01, 2005 7:30 pm
by haffax
Well the problem is simply that, as long as you don't have light in your scene, the model is black, because you don't let it reflect any ambient light.

cnage ambient 0 0 0 1 to maybe ambient 0.7 0.7 0.7 1 and it should work. :)

Posted: Tue Mar 01, 2005 8:23 pm
by Lmlange
cc thx.

Some small n00b mistakes here :-), but it works now.

Now I need to fix some cool shadows and lights for it