我见过在Daz3d,poser,makehuman等软件中,当衣服所穿的模型被修改(通常带有变形)时,衣服项目的3d模型会自动重塑形状。我有一种情况,我必须在opengl es中做一些类似的事情。有人能告诉我这样做背后的逻辑吗?是变形又起作用了,还是有其他方法呢?有没有网格修改库
发布于 2016-03-19 19:55:56
我会这样做:
通常表示为某些拓扑网格中的嵌套点网络。为此,我会把衣服分成“圆柱体”。每个“圆柱体”将由一个点网格表示,如下所示:
结构拉伸{ float x,y,z;bool _pnt,done;};_pnt pntna3;
where
- `na` should be dependent on the cylinder diameter but usually `na=36` is more then enough in all cases
- `nb` should be dependent on the "cyliner" height and cloth detail ...
每个点都有它的3D坐标x,y,z,最初设置为布料的形状,就像气球一样充满空气一样。如果点在某个橡皮筋上,stretch就会标记出来,迫使它粘在皮肤上。done只是用于计算的临时标志。
现在,如果您想要计算实际的布料形状,则需要:
1. set `done=false` for all points
2. set all `stretch`ed points to their corresponding position on person/dummy skin (mesh surface) and set `done=true` for them. These points will be usually covering whole slice `(b=constant,a=0,1,2,...na-1)`
3. for each stretched point `(a0,b0)` compute the chained points. The math/physics behind it is this: - [Catenary Curves](http://home.earthlink.net/~w6rmk/math/catenary.htm)
- [Newtonian / D'ALembert dynamics](https://stackoverflow.com/a/19764828/2521214)所以,如果你击中了另一个stretch点,扫描这些点,使用第三曲线,如果没有,使用Newtonian /D‘’Alembert动力学模拟来获得位置(对于你需要将速度vx,vy,vz添加到_pnt。计算位置时,设置所有计算点的done=true。
此外,如果一个点的计算位置在头像网格内,你必须将其位置设置为头像表面,并将其速度设置为零。
处理网格自碰撞(动态影响)
1. search all non computed points `done==false` and interpolate their position from their computed neighbors.
如果你让它工作,你可以添加更多的特征,如弹性,质量,...每个点和更多点的系数。
https://stackoverflow.com/questions/36067626
复制相似问题