Trouble about COLLADA (Octree and texture)
Trouble about COLLADA (Octree and texture)
Hi,
I use Irrlicht for a school project and we got a problem with COLLADA.
the real meshes looks like this :
http://picasaweb.google.fr/lh/photo/8aE ... directlink
but in Irrlicht, every meshes is reverted in Z axis (Textures and meshes)
also, the textures become black accordind the camera angle , why ?
http://picasaweb.google.com/lh/photo/Mv ... directlink
thanks.
I use Irrlicht for a school project and we got a problem with COLLADA.
the real meshes looks like this :
http://picasaweb.google.fr/lh/photo/8aE ... directlink
but in Irrlicht, every meshes is reverted in Z axis (Textures and meshes)
also, the textures become black accordind the camera angle , why ?
http://picasaweb.google.com/lh/photo/Mv ... directlink
thanks.
--
Shomaa
Shomaa
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
The zbuffer problem is probably related to the z-up problem that wasn't solved in Irrlicht 1.5 IIRC. The current SVN/trunk version has this fixed, though, and usually handles geometry and textures correctly. Transparency is not correct in most situations, though. I could test the mesh with the latest meshviewer version and maybe also fix the other problems if you can provide me with the mesh.
After several try ,the resultat is still the same, the z axis is reverted ,and worst ,the collada meshes doesnt support several texture anymore... 
http://picasaweb.google.com/lh/photo/nK ... directlink
i post my code here, it's for loading a collada file with several textures :
http://picasaweb.google.com/lh/photo/nK ... directlink
i post my code here, it's for loading a collada file with several textures :
Code: Select all
IAnimatedMesh *anim = this->_engine->GetSmgr()->getMesh("media/pack/Character/NPC/Haruhi_npc/Ai_npc01.dae");
ISceneNode* node = this->_engine->GetSmgr()->addAnimatedMeshSceneNode(anim);
node->setMaterialTexture(0,this->_engine->GetDriver()->getTexture(
"media/pack/Character/NPC/Sourceimages/Character/Ai_Shadow_01.png"));
node->setMaterialTexture(1,this->_engine->GetDriver()->getTexture(
"media/pack/Character/NPC/Sourceimages/Character/Ai_npc01.png"));
node->setMaterialTexture(2,this->_engine->GetDriver()->getTexture(
"media/pack/Character/NPC/Sourceimages/Character/Ai_npc01_Eyes.png"));
node->setMaterialTexture(3,this->_engine->GetDriver()->getTexture(
"media/pack/Character/NPC/Sourceimages/Character/Ai_npc01_Mouth_01.png"));
node->getMaterial(0).MaterialType = irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL;
node->getMaterial(1).MaterialType = irr::video::EMT_SOLID;
node->getMaterial(2).MaterialType = irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL;
node->getMaterial(3).MaterialType = irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL;
node->setMaterialFlag(irr::video::EMF_LIGHTING,false);
this->_player[_nb_player_current]->SetPlayerNode(node);--
Shomaa
Shomaa
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
You should note that the Collada loader always creates a scene, not just a single mesh. So be sure you find the proper node when changing the material. At least the NPC is loading properly with latest SVN/trunk. You should try to export the normals, though, because right now the mesh looks not nice when being lit.
I found my first error:
because the file is a .DAE, you must add the flag video::EMF_FRONT_FACE_CULLING , for avoid the blink of texture (because the mesh is one textured...)
but the second problem remain here the screenshot :
http://picasaweb.google.com/lh/photo/xC ... directlink
the mesh is still inverted...
because the file is a .DAE, you must add the flag video::EMF_FRONT_FACE_CULLING , for avoid the blink of texture (because the mesh is one textured...)
but the second problem remain here the screenshot :
http://picasaweb.google.com/lh/photo/xC ... directlink
the mesh is still inverted...
--
Shomaa
Shomaa