Loading large 3DS mesh goes quite wrong

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
Jimbo

Loading large 3DS mesh goes quite wrong

Post by Jimbo »

When trying to load quite a large mesh irrlicht crashes. Diving into
what's happening I found the following:

Code: Select all

void C3DSMeshFileLoader::readVertices(io::IReadFile* file, ChunkData& data)
{
	file->read(&CountVertices, sizeof(CountVertices));
CountVertices is declared as a s16 (signed short). I've changed
this to an u16 (unisigned short). That helped not getting a negative number here.

Code: Select all

if (data.header.length - data.read != vertexBufferByteSize)
	{
		os::Printer::log("Invalid size of vertices found in 3ds file.", ELL_WARNING);
//		return;
	}
I've commented out the return. Since this is an exported .3ds mesh from 3ds max 6 I have no idea what's wrong about it. It loads fine after removing the return (perhaps just a warning?).
PadrinatoR
Posts: 50
Joined: Tue Mar 09, 2004 9:53 pm
Location: Spain

Post by PadrinatoR »

Yes, I have the same problem when I try to load a very complex model with lots of vertices and faces.
There are only 10 types of people: those who understand binary and those who don't

--------------------------------------------

Image
Post Reply