# [MDX] Mesh breaking up

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

## Recommended Posts

Hi, I currently have a mesh that consists of several parts for the purpose of animating. When the mesh is stationary it looks fine - all the parts are where they should be. The problem occurs when I start to move the mesh. I am using the LoadHierarchyFromFile function to load the mesh, and am using the standard DrawMeshContainer method to draw it. I set the world transform at the same location that the MS sample does - which includes the particular parts translation etc as well as it's location in the world. When I move the model, especially at high speeds (say, 100 units every frame), the mesh starts to shake and break up. I'm guessing that this may have something to do with the precision of the units. If Eg. if the model starts at position (0,0,0), by the time it gets to (200000,0,0) it has become broken up, not too much, but it is noticable. I am using a Vector3 to store the position of the mesh, and also use it when calculating the translation matrix. Any solutions? Cheers

##### Share on other sites
If it really is a precission issue, maybe reducing the scale you use in your application just might help a little bit. Another thing worth looking into is how you calculate the matrices for the parts. Using the same global world matrix for the translation and multiplying that with the 'offset matrix' of the parts should be less prone to rounding errors (and generally more stable) than recalculating the matrices seperately for each part.

In pseudo-code, something like this:

Vector3 meshSpeed = new Vector3(1, 0, 0); // or whateverMatrix meshWorld = Matrix.Translation( meshSpeed * timeStep );foreach(Part p in Mesh.Parts){   Matrix partMatrix = p.BaseTransform * meshWorld;   // render with this matrix}

I hope this makes some sense and is of some use [smile]

• 11
• 19
• 12
• 9
• 34
• ### Forum Statistics

• Total Topics
631398
• Total Posts
2999840
×