I can't see the model

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
Elenthidir
Gnoblar
Posts: 12
Joined: Wed Dec 10, 2014 11:29 am

I can't see the model

Post by Elenthidir »

I have a model which I've exported in from Blender using the OgreExporter (no errors)
Than I've converted the model from the xml format to the binary mesh unsing the OgreXMLConverter (no errors)

Now I want to load the whole thing into my Ogre Scene using this code:

Code: Select all

	GameManager::getInstance()->getSceneManager()->setAmbientLight(Ogre::ColourValue::White);

	// Load the mesh from the folder
	playerNode = GameManager::getInstance()->getSceneManager()->getRootSceneNode()->createChildSceneNode("playerNode");
	//playerNode->rotate(Ogre::Vector3::UNIT_Y, Ogre::Radian(Ogre::Math::PI));
	playerNode->setPosition(0,0,-25.0f);
//	playerNode->scale(1.0f,1.0f,1.0f);
	//sinbadNode->rotate(Ogre::Vector3(0,1,0),Ogre::Radian(Ogre::Degree(90)),Ogre::Node::TS_WORLD);
	playerEntity = GameManager::getInstance()->getSceneManager()->createEntity("vincent_Casual_Male_Lod_0","Untitled.mesh");
	playerEntity->setMaterial(Ogre::MaterialManager::getSingletonPtr()->getByName("vincent_Casual_Male_Lod_0Mat"));

	if(playerEntity)
		playerNode->attachObject(playerEntity);
If I use sinbad instead of my own model, everything works perfectly fine and I can see the model, but as soon as I am using my model, I cant see anything... there is no model..

Here is a link to the model (mesh, skeleton, material and texture) it also includes the ogre.log, in which I cant find anything bad.
https://drive.google.com/file/d/0Bx9OKn ... sp=sharing

Can anyone tell me why I do not see my model?
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: I can't see the model

Post by al2950 »

Thank you for supplying the files, it makes it sooooooooo much easier to help you!

You model is 100x bigger than sinbad, so your camera is probably inside your model. Try adjusting the scale;

Code: Select all

playerNode->setScale(0.01, 0.01, 0.01);
Elenthidir
Gnoblar
Posts: 12
Joined: Wed Dec 10, 2014 11:29 am

Re: I can't see the model

Post by Elenthidir »

Thanks! It worked!

Can you explain me how you found out that my model is so much bigger? I've imported Sinbad into the same blender scene and there my model was a little bit shorter than sinbad.

Anyway thanks!
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: I can't see the model

Post by al2950 »

No worries

I loaded it into my engine and as I have a full lighting system with shadows, I could see it casting a shadow! To be honest it could only be a couple of things, and in case you have a similar issue but cant find the solution check and make sure the skeleton is not screwing it up. I have exported a skeleton before which seemed to export and load fine but it spread my model to opposite corners of the universe!!
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: I can't see the model

Post by al2950 »

I should also point out getting familiar with a frame debugger is very good idea. I would check out one of the following;
NVIDIA NSight
AMD GPU Perf Studio
RenderDoc - This is an open source project and is looking very promising, but does not support dx9
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: I can't see the model

Post by Kojack »

OgreMeshy is very handy for these situations. I use it all the time when working with exports. Just double click the .mesh file (I bound it in windows as the open event) and you have it displayed. In the tree panel on the left it shows the bounding size of the mesh (it's 614 tall).

If sinbad and your mesh look similar size in blender, then your mesh probably has scaling on it. It's actual geometry is huge but is scaled down (blender keeps track of that). The export is just the geometry as it would be without the scale.
You can apply the scale to the mesh in blender by going to object mode, pressing Control-A and selecting Scale. It should then export at a similar size to sinbad.
Elenthidir
Gnoblar
Posts: 12
Joined: Wed Dec 10, 2014 11:29 am

Re: I can't see the model

Post by Elenthidir »

Thanks very much.
Unfurtunatly OgreMeshy is not working at my computer. When I start the program nothing happens, but I found OgreMeshViewer, will provides nearly the same information.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: I can't see the model

Post by Kojack »

Move the cg.dll library from the plugin directory to the directory with the ogremeshy.exe. It's in the wrong place (not everybody notices because if you have the cg sdk installed then the cg.dll is in your system path and always found).
Elenthidir
Gnoblar
Posts: 12
Joined: Wed Dec 10, 2014 11:29 am

Re: I can't see the model

Post by Elenthidir »

Moving the dll worked. Thanks OgreMeshy is much better than OgreMeshViewer! Thanks
Post Reply