Domanda

I just finished to setup Blender so it can export to Ogre. When I am exporting I get a bunch of mesh files and a scene file.

I am loading the model that the Ogre SDK provides and it works like so:

mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5f, 0.5f, 0.5f));

// Create an Entity
Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");

// Create a SceneNode and attach the Entity to it
Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("HeadNode");
headNode->attachObject(ogreHead);

// Create a Light and set its position
Ogre::Light* light = mSceneMgr->createLight("MainLight");
light->setPosition(20.0f, 80.0f, 50.0f);

What's happening is that it loads a single mesh file and that's it.

This is the Blender export output:

enter image description here

What do I need to do from here in order to load my model?

È stato utile?

Soluzione

It depends a bit on what you want to achieve.

Currently you have created a scene in blender containing multiple parts that together result in your BlackHawk helicopter. If you just need a single object in Ogre, you can combine the elements inside Blender into one object, export that and use the same loading code as before (using the new .mesh file name of course).

If you want the individual parts to stay independent, you will have to load them into Ogre one by one or use one of the many DotScene loaders (e.g. this one or that one or the one that also handles user data) and point it to your "BlackHawk.scene" file (which should reference all helicopter parts).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top