Please explain about Alias Wavefront Maya format

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
KonH
Posts: 1
Joined: Fri Mar 11, 2011 1:38 am

Please explain about Alias Wavefront Maya format

Post 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 :)
random
Posts: 158
Joined: Wed Aug 11, 2010 6:01 am

Post 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.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Please explain about Alias Wavefront Maya format

Post 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.
Working on game: Marrbles (Currently stopped).
Post Reply