Why does my 3D model shrinks/deform over time ?

Question


«In my 3D engine, each frame I modify my mesh to account for its movement, or change the camera point of view. I do it incrementally. That is each frame I multiply previous frame position with a new matrix that represents the delta in position between frames. What I found is that after a few frames my mesh is flatten to a dot, or becomes skewed. Is there something I can do to solve that problem ?»

Answer


It's what floating point does for you, repeated transform makes precision worse and worse.

Rather than what you do, you should keep original instances of all your data in memory : meshes (read only), angles (or quaternions), scaling, translation vector.

If you do anything incremental (like an incremental rotation of an object), then you keep as many parameters separated as possible, for example you compute rotation as a separate matrix that you normalize, orthogonalize every now and then so that it doesn't shrink, expand and skew. If you do it often enough, things won't pop up as the "correction" will be minor each time.


If you want to learn more..




Partner websites : LEGREG | GRAPHICS | GRAPHISME | PHOTOGRAPHY | OUT OF MY MIND | ANIMATION MENTOR | GREEN LIVING | VOXEL | RAY TRACING | GUENARDI | Add this page rank counter to your page.