Sign in to follow this  
saravananps

Problem with welding the vertices of a mesh

Recommended Posts

Hi i created a mesh which contains duplicated vertices. so i welded the vertex data using the D3DXWeldVertices() function. in the runtime i'm getting an Debug Error: Damage after normal block (#895) at a memory location. using the debug mode i found that the weldfunction causes the problem the code
        LPD3DXMESH pTempMesh;

	// Weld the vertices to remove the duplicated vertex
	// Set the epsilons to 0.001
	D3DXWELDEPSILONS WeldEpsilons;

	float *pFloats = (float*) &WeldEpsilons;

	// Initialise all the members of the D3DXWELDEPSILONS to have a     
        //tolerance value of 0.001
	for (i=0; i<sizeof (D3DXWELDEPSILONS) / sizeof (float); i++)
	{
		*pFloats++ = 1e-3f;
	}

	// Weld the vertex data
	if (FAILED (D3DXWeldVertices(pTempMesh,
                                     D3DXWELDEPSILONS_WELDPARTIALMATCHES |	    
                                      D3DXWELDEPSILONS_DONOTSPLIT,
				      &WeldEpsilons,
			               NULL,
				       NULL,
				       NULL,
				       NULL)))
	{
		pTempMesh -> Release ();
		return false;
	}


Please help me

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this