Issue when loading .mesh/.material created with oFusion

idamien

05-05-2006 21:12:35

Hi...

Brand new here, just started using Ogre and oFusion to create my own .mesh/.material files... Great tool!

Having a small problem though: created a very simple model with 3ds Max with a very simple Ogre Material on it and exported to .mesh/.material file using oFusion; created a simple app (based on the Ogre Wiki tutorials) to open .mesh files just to view them BUT my created model doesn´t seem to be loading properly....!!!!

Got the media dir into resources.cfg and put all .mesh/.material files into said dir and used the simple createEntity code to load the mesh into application but, although the app compiles and runs without any errors, I can see nothing on the screen when running the Ogre app...

Any clues, ideas, suggestions, hints, anything????

Also here is something I´m very curious to know: what´s the unit used for measure in Ogre models? Maybe this is a stupid n00b question but I´m interested... My model was created as a 5 x 5 x 0.125 m(eter) box in 3ds max. My question is... how will this translate into Ogre units? Too big so that maybe my app is loading inside the box and so I cannot see it? Or maybe too small???

Please help... Thanks in advance!!!

idamien

05-05-2006 21:41:42

I just thought I should say that I have tried to load other model/.mesh files into the app (e.g. those that come with the ogre demos/samples) and they worked just fine... Also, yes, I have set ambient lighting so that I am not staring at a completely dark scene.

idamien

05-05-2006 21:53:53

I just tried using the setMaterialName method on my created entity. After calling this function with the material file name created by oFusion I was able to see the object in the Ogre app... BUT, although the object geometry seemed to be correct, the object material was plain white!!! I had defined a texture in the material and I did copy the texture file into the media dir specified in the resources.cfg but the object is rendered with a plain white material, and even that ONLY AFTER I called the setMaterialName method with a valid material name...

idamien

05-05-2006 22:10:58

OK... I guess a valid way of learning about Ogre is to try and do things the wrong way to see how they work...

After I called the setMaterialName I went on to search the Samples\Media directory to see if there were any other material scripts (.material) with the same name as mine. I couldn´t find any. So I tried to load my mesh with a different material, one of those in the Samples\Media\Material\Scripts dir and I couldn´t, at least not by using the FILE name of the material... So I opened the script file to see that every material definition has a declared name (Duh!!!) which I then tried and found out to be the name by which Ogre recognizes and fetches/applies materials. So I tried to load my oFusion exported material by its declaration name in the script file but it didn´t work...! So now I´m stuck guessing that one needs to register material scripts prior to using them.

Can anyone please tell me how? In the meantime I´m gonna go through the ExampleApplication.h to see if I can find anything there...

Lioric

06-05-2006 16:52:29

If you are using the ExampleFramework then the paths declared in resource.cfg file will be parsed and initialized at the setupResources method

Post your ogre.log file, in there you can see if the paths were added to the resource groups and if material files where parsed

In what resource group are your materials added?

You can compile the Scene Loader Demo application and start from there