Friday, November 13, 2009

Collision Detection

Collision detection for hair strands. That's a tough nut to crack! Makehuman does not have it yet, but in the svn you can find workable python codes that can be used in Blender (namely makehair). I used an old octree code donated to Manuel and I modified it a bit. But Octree alone will not save you of all the troubles. Most of the difficulties arise in things like: 
  1. Starting after what length of the strands should one start doing a collision detection
  2. Octree is used because it makes the method inexpensive, but given bad resolution at certain mesh levels it can give us really poor results.. so we need extra algorithms for that (like in case of Bezier hairs, after a collision is detected and hair is deflected one should skip the next control point and not look for collision there..etc.)
  3.  Cup-shaped meshes poses the biggest problem when hair falls into them (like the collar bones).. even with the best algorithms I have written so far, you can get some strands passing through the body.

But in general, I am satisfied with the results. Hair looks more natural and follow the tangent of the upper body and the neck. Now if I could figure out... how to exactly solve the problem with the hair ends (see the figure) after I make the collision detection!





No comments:

Post a Comment

© MHteam 2001-2010