[fixed]CIrrMeshWriter or CIrrMeshFileLoader bug.
Posted: Sun May 23, 2010 10:44 am
NOTE: my English is very bad
ok, i use the code: ( load OBJ file )
Final results:
now, i use the code convertion OBJ to IRRMESH:
then, i use the code: ( load IRRMESH file )
Final results:
We have seen, the color wrong.
But I found a solution.
Solution:
at CIrrMeshWriter.cpp line 186:
Change to:
Solve the problem!
ok, i use the code: ( load OBJ file )
Code: Select all
node = smgr->addMeshSceneNode( smgr->getMesh( "../Media/Map/sponza_clean.obj" ) );
node->setMaterialFlag( EMF_LIGHTING, false );
now, i use the code convertion OBJ to IRRMESH:
Code: Select all
IWriteFile *wf = device->getFileSystem()->createAndWriteFile( "../Media/Map/sponza_clean.irrmesh" );
smgr->createMeshWriter( EMWT_IRR_MESH )->writeMesh( wf, smgr->getMesh( "../Media/Map/sponza_clean.obj" ), EMWT_IRR_MESH );
wf->drop();
then, i use the code: ( load IRRMESH file )
Code: Select all
node = smgr->addMeshSceneNode( smgr->getMesh( "../Media/Map/sponza_clean.irrmesh" ) );
node->setMaterialFlag( EMF_LIGHTING, false );
We have seen, the color wrong.
But I found a solution.
Solution:
at CIrrMeshWriter.cpp line 186:
Code: Select all
sprintf(tmp, " %02x%02x%02x%02x ", vtx[j].Color.getAlpha(), vtx[j].Color.getRed(), vtx[j].Color.getBlue(), vtx[j].Color.getGreen());
Code: Select all
sprintf(tmp, " %02x%02x%02x%02x ", vtx[j].Color.getAlpha(), vtx[j].Color.getRed(), vtx[j].Color.getGreen(), vtx[j].Color.getBlue());