using MOGRE_OSMSceneLoader_2

pepote

20-06-2007 22:32:44

I need someone will talk me if I'm using correctly the OSMSceneLoader_2

private void CreateScene()
{
SceneManager mgr = mRoot.CreateSceneManager(SceneType.);
cam = mgr.CreateCamera("Camera");
mgr.AmbientLight = ColourValue.Red;
mgr.ShadowTechnique = ShadowTechnique.SHADOWTYPE_STENCIL_ADDITIVE;
CreateViewPort(cam);

//Creamos un personaje
ent = mgr.CreateEntity("ninja", "ninja.mesh");
ent.CastShadows = true;
ninjaNode = mgr.RootSceneNode.CreateChildSceneNode();
ninjaNode.AttachObject(ent);




cam.Position = new Mogre.Vector3(0, 200, -600);
cam.FarClipDistance = 5;
cam.LookAt(0, 0, 0);
//mgr.SetShadowUseInfiniteFarPlane(false);

OSMScene loader = new OSMScene(mgr, mWindow);
loader.Initialize("maderaypiedra.osm");
loader.CreateScene(mgr.RootSceneNode);


}


Why we need pass to OSMSceneLoader a SceneManager? In 3DMax we create one to it, really?

smernesto

07-07-2007 04:01:39

Hi.

You can pass a null reference, and the OSMLoader will create the scenemanager.


...
OSMScene loader = new OSMScene(null, mWindow);
loader.Initialize("maderaypiedra.osm");
loader.CreateScene(null);

//CREATE CAMERA
//CREATE NINJA ENTITY



If you let the OSMLoader create the scenemanager then you have to move your code for entity and camera creation, after you create the scene with the loader. The ambient light is established in the osm file and the shadow technique also.

Bye

Ernesto