Hi all
I'm noob with material and stuff like that as I haven't look into it in Irrlicht.
I'm trying to load obj file exported from 3DSMax, but have some issue with it displaying correctly.
Can anyone show me how to do it correctly please.
The mesh file is the path to "media/Robot/Kuko/Axis1.obj"
The code I used is given below:
IAnimatedMesh* mesh = smgr->getMesh(m_meshFile);
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh);
scene::ITriangleSelector* selector = 0;
if (node)
{
node->setName(name);
node->setMaterialFlag(EMF_LIGHTING, false);
if (pickable == true)
{
selector = smgr->createTriangleSelector(node);
node->setID(ID_PICKABLE);
node->setTriangleSelector(selector);
selector->drop();
}
else
{
node->setID(ID_NOPICK);
}
}
Thanks
Thanh
[Solved] How to correctly load obj file.
[Solved] How to correctly load obj file.
Last edited by thanhle on Thu Nov 06, 2014 5:33 pm, edited 1 time in total.
Re: How to correctly load obj file.
The only reason you see those contours in Max is because of lighting, and you disabled lighting in irr.
Re: How to correctly load obj file.
Thanks mate,
I'll start reading tutorial on light.
Regards
Thanh
I'll start reading tutorial on light.
Regards
Thanh
[Solved] How to correctly load obj file.
Now it looks much better. Although needs more tweaking to get it right.
My current lights setting are:
Anyone have any better light values that we can share?
Thanks
thanh
My current lights setting are:
Code: Select all
smgr->setAmbientLight(irr::video::SColorf(0.4, 0.4, 0.4));
scene::ILightSceneNode* light = smgr->addLightSceneNode();
irr::video::SLight &slight = light ->getLightData();
slight.Type = video::ELT_DIRECTIONAL;
slight.DiffuseColor = irr::video::SColorf(0.75, 0.75, 0.75, 1.0);
slight.AmbientColor = irr::video::SColorf(0.1, 0, 0.1, 1.0);
slight.SpecularColor = irr::video::SColorf(0.2, 0.2, 0.2, 1.0);
scene::ILightSceneNode* light2 = smgr->addLightSceneNode(0, vector3df( 0, 0, 0));
light2->setRotation(vector3df(120, 0, 0));
irr::video::SLight &slight2 = light2->getLightData();
slight2.Type = video::ELT_DIRECTIONAL;
slight2.DiffuseColor = irr::video::SColorf(0.75, 0.75, 0.75, 1.0);
slight2.AmbientColor = irr::video::SColorf(0.1, 0.1, 0.1, 1.0);
slight2.SpecularColor = irr::video::SColorf(0.3, 0.3, 0.3, 1.0);
Thanks
thanh