Page 1 of 1

I can't see the model

Posted: Mon Feb 02, 2015 3:48 pm
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?

Re: I can't see the model

Posted: Mon Feb 02, 2015 4:05 pm
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);

Re: I can't see the model

Posted: Mon Feb 02, 2015 4:13 pm
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!

Re: I can't see the model

Posted: Mon Feb 02, 2015 4:18 pm
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!!

Re: I can't see the model

Posted: Mon Feb 02, 2015 4:28 pm
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

Re: I can't see the model

Posted: Mon Feb 02, 2015 5:16 pm
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.

Re: I can't see the model

Posted: Tue Feb 03, 2015 1:59 pm
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.

Re: I can't see the model

Posted: Tue Feb 03, 2015 8:25 pm
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).

Re: I can't see the model

Posted: Wed Feb 04, 2015 2:25 pm
by Elenthidir
Moving the dll worked. Thanks OgreMeshy is much better than OgreMeshViewer! Thanks