Problem loading Mesh.

Problems building or running the engine, queries about how to use features etc.
Post Reply
Lmlange
Gnoblar
Posts: 13
Joined: Fri Feb 25, 2005 2:51 pm

Problem loading Mesh.

Post 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));
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post 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?
team-pantheon programmer
creators of Rastullahs Lockenpracht
Lmlange
Gnoblar
Posts: 13
Joined: Fri Feb 25, 2005 2:51 pm

Post 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?
Lmlange
Gnoblar
Posts: 13
Joined: Fri Feb 25, 2005 2:51 pm

Post by Lmlange »

I also try add mShip->setMaterialName("Examples/Elco"); and placed it in the Example MAT-fil
Lmlange
Gnoblar
Posts: 13
Joined: Fri Feb 25, 2005 2:51 pm

Post by Lmlange »

Maybe something im missing in the OgreMaya?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post 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:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post 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. :)
team-pantheon programmer
creators of Rastullahs Lockenpracht
Lmlange
Gnoblar
Posts: 13
Joined: Fri Feb 25, 2005 2:51 pm

Post 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
Post Reply