• Advertisement
Sign in to follow this  

Problem with welding the vertices of a mesh

This topic is 4248 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Sign in to follow this  

  • Advertisement