#8 Error by CIFXAuthorCLODEncoderX::MakeAuthorCLODProgressiveGe

open
nobody
None
5
2006-10-30
2006-10-30
gejza01
No

Hi, i think i found an error by this "nice" 2500 lines
long function. If i use your code from Helloworld, to
export a little bigger object to convert it to u3d
format, then it goes to heap error. And i know why.

So:
I want to generate an object, which have 48 vertices,
264 normal index from the normal array, with 88 faces.
Then the function try to create the LOD objects from 0-
48 (minresolution to maxresolution) and it makes that
in a while cycle through the actual resolution.
Then somewhere want to create a new object from that.
But the problem is that the normalindex count goes
from 264 to more like 1000!!!. Then the function
writes back this new object to the
m_pReconstructedAuthorCLODMesh (memcpy). But while the
normals is more like the original, it writes over the
original object!!! Then of course it occures memory
heap error.

If i change in the helloworld file:
// Set mesh compiler parameters and compile mesh
(create progressive updates)
if (IFXSUCCESS(result))
{
IFXAuthorGeomCompilerParams aparams;
// Set minimal resolution to make all
mesh progressive (no base mesh)

aparams.CompressParams.bSetMinimumResolution =
TRUE;

aparams.CompressParams.uMinimumResolution = 48;
// Set default quality

aparams.CompressParams.bSetDefaultQuality =
TRUE;
aparams.CompressParams.uDefaultQuality
= IFX_DEFAULT_QUALITY_FACTOR;
// Set compiler flag to use
assignments above
aparams.bCompressSettings = TRUE;
// Progress function could be set to
be called during CLOD creation process
aparams.pProgressCallback = NULL;
result = pCompiler->Compile
(modelResourceName, pAuthorClodMesh,

&pAuthorClodResource, FALSE,
&aparams);
}

You see the uMinimumResolution = 48 is the number of
vertices, then everything is ok. So if i don't want
CLOD, then runs correctly.

Discussion


Log in to post a comment.