Page 1 of 1

Please explain about Alias Wavefront Maya format

Posted: Fri Mar 11, 2011 1:45 am
by KonH
Please help me with the format Alias Wavefront Maya (.obj) in Irrlicht.
My situation:
- I have *.obj and *.mtl files in this format.
- I need to load the scene and apply textures using the mtl file.

If I use LoadScene() function, nothing is displayed. How to load textures using mtl file?

Thanks in advance and sorry for my english :)

Posted: Fri Mar 11, 2011 6:58 am
by random
i can only tewll you for blender exported *.obj files.

to export from blender:

*mark anything you want to export
*file > export >*.obj
*choose a folder to put in the obj and mtl and gice it a desired name
(i only export usualsy one mesh or even 2,3 which are non animated...)
*mark
~aplly modifiers
~rotate x90
~copyimages!!!!(important)
~edges
~triangulate
~polygroups
~materials
~uv´s
~nurbs
~normal
~HQ
~objects
~groups
~material group

click export

now you have ready to use, *.obj, *.mtl ang the image file.

To build in:

Code: Select all

        ISceneNode* myNode = mgr->addMeshSceneNode(mgr->getMesh("../../media/weaponL.obj"), parentNode);

myNode->setRotation(core::vector3df(0,0,0));
        myNode->setMaterialFlag(video::EMF_LIGHTING, false);
        myNode->setMaterialFlag(EMF_BACK_FACE_CULLING, false);
        myNode->setMaterialFlag(EMF_FRONT_FACE_CULLING, false);

no need to load teture or imagem just dont rename obj or mtl file bothe must have the same name and be in the same folder, also dont rename the image(which may is not named like your mesh), because irrlicht loads the *.mtl file that fits the name of the *.obj file and inside the .mtl file the image is listed.

thats it , if you still see nothing you wether saved the .obj in a wrong folder (my example uses the irrlicht media folder), or have to also add a light to the scene;)

btw when u use Blender with these settings to export the mesh should face the right side of your monitor to be sure it faces the + of the Z axis in Irrlicht (looking away from you), if you want it looking toward you you have to make it look to the right side of blender but you will have a rotation of (0,180,0) from the bedinning.

Re: Please explain about Alias Wavefront Maya format

Posted: Fri Mar 11, 2011 8:16 am
by serengeor
KonH wrote:Please help me with the format Alias Wavefront Maya (.obj) in Irrlicht.
My situation:
- I have *.obj and *.mtl files in this format.
- I need to load the scene and apply textures using the mtl file.

If I use LoadScene() function, nothing is displayed. How to load textures using mtl file?

Thanks in advance and sorry for my english :)
I think you're not supposed to use load scene for obj or anything else but .irr format(it can be made in IrrEdit).
To load your .obj do it like entity said.