joi, 21 iulie 2011

Volume Meshing and Deforming a 3D Max object in XNA

The problem:
Load an .fbx object and deform it by selecting forces and freedom restriction for some nodes(fix some points). As we all now an .fbx object is composed of triangular surfaces representing only the surface, there fore I have to convert it to a solid body on which we apply the DSM FEM algorithm.

My approach:
Volume Meshing:
-remesh the surface into lines (trusses)
-eliminate the duplicate lines and vertices (apparently for a cube I got 24 instead of 8...I guessed they were for texture mapping)
- find a point inside the object(tricky for concave objects);
-create a 3D matrix of indices (a volume block);
-start to move inside the matrix and assign the indices vertices that check the inside_the_shape condition;
-inside_the_shape condition a point is farther than "step" than every vertex of the shape, if not tie it to the vertex with a line but no other point goes beyond;
(so far worked..except for step<length of shape edge--it gets out of the shape and does not work if center is to close to a surface-- it connects to it and stops there);

DSM-FEM:
(for those who know what I'm talking about)
-built K matrix from line indices vector;
-created the equation system from K and non fixed points;
-solve the system using Gauss-Jordan row reduction;
Issue:
in some cases I get a 0 determinant and I don't know how to interpret (yes I know that the x corresponding to the 0 may take any value)

Interface:
-navigate trough points using + & - ..very nasty after meshing ..indices are really messed up;

Result below:
applied force: node 0 (100,10,10);
fixed nodes(X,Y,Z):1,2,3;

Niciun comentariu:

Trimiteți un comentariu