[fixed]CIrrMeshWriter or CIrrMeshFileLoader bug.

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
shine5128
Posts: 5
Joined: Sun May 02, 2010 12:14 pm

[fixed]CIrrMeshWriter or CIrrMeshFileLoader bug.

Post by shine5128 »

NOTE: my English is very bad :)

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 );
Final results:
Image



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 );
Final results:
Image


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());
Change to:

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());
Solve the problem! :D
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, thanks, that's fixed now.
Post Reply