maya动力学有以下几套系统:1.刚体、柔体系统
刚体系统的典型节点连接方法如下:
物体的变换节点、形状节点连接rigidBody节点,刚体节点输出力到解算器节点,解算器输出新的变换到变换节点
值得注意的是柔体系统实际上是用粒子实现的,通过给每个网格顶点赋予一个粒子,再让粒子反过来操纵网格,实现网格的变形。
通过在粒子之间创建大量弹簧,实现粒子之间的相互影响,于是物体看上去就像发生了弹性变形一样。
弹簧的节点连接方法如下:
2.普通粒子系统
普通粒子系统可以同网格物体发生碰撞。典型节点连接方法:
网格的形状节点输出到geoConnector节点,这个节点输出一个sweptGeometry,粒子根据sweptGeometry数据计算自身是否应该反弹。
sweptGeometry表示一个几何体一帧之内每个三角形扫过的区域。其存放几何体每个三角形在此帧前后的位置。
可以发现此种连接方式没有影响形状节点的输入,也就是影响是单向的,物体影响粒子系统,但是粒子系统不影响物体。
3.n粒子系统、n布料系统
默认情况下,n粒子系统可以同n布料系统发生碰撞。
n布料系统通过调整物体的刚性参数,可以模拟布料,也可以模拟柔体、刚体,是一个多功能的系统。
n粒子系统的节点连接方式是:
n粒子的形状节点的current state、start state输出分别连到nucleus解算器节点的inputActive、inputActiveStart输入中,解算器节点的outputObjects属性连到形状节点的nextState属性中。这几个属性都是Nobject类型。
n布料的连接方式与此相同。
还有一种称为Passive Object,也就是会影响n粒子、n布料,但是自身我行我素不受影响的物体。这种物体的连接方式如下:
nRigid物体的输出连入nucleus解算器,但解算器无输出连到物体本身。
值得注意的是nRigid物体在模拟过程中是允许变形的,但是网格拓扑不能变。
可见n系统工作方式是:把所有n物体都输入nucleus节点,再把节点的解算结果传回给对应的n物体。
n粒子可以实现粒子之间的堆叠(因为粒子之间可以存在作用力)
几个与粒子有关的mel命令:
命令 | 功能 | 典型用法 |
event | 插入一个碰撞事件,可以是粒子分裂、粒子出生,或者调用外部函数 | event -proc myProc myCloud;
// Call the MEL proc // "myProc(name, id, name) each time a particle // of myCloud collides with anything. |
getParticleAttr | 获得粒子系统的属性,返回平均值,或者是数组 | getParticleAttr -at velocity particle1;
// This will return the average velocity for the entire particle
// object as well as the maximum offset from the average.
getParticleAttr -at velocity particleShape1.pt[0:7] particleShape1.pt[11];
// This will return the average velocity for particles 0-7 and 11
// as well as the maximum offset from the average.
|
particle | 创建粒子、编辑、修改粒子属性 | particle -attribute velocity -order 7 -q; // Returns the velocity of the 7th particle in the currently selected
// particle object
particle -e -attribute velocity -order 7 -vectorValue 0.0 1.0 0.0; // Edits the velocity of the 7th particle in the currently selected
// particle object to be 0.0, 1.0, 0.0
|
nParticle | 与particle命令类似 | nParticle -attribute velocity -order 7 -q; // Returns the velocity of the 7th particle in the currently selected
// particle object
nParticle -e -attribute velocity -order 7 -vectorValue 0.0 1.0 0.0; // Edits the velocity of the 7th particle in the currently selected
// particle object to be 0.0, 1.0, 0.0
|
关于maya动力学系统的一些总结
原文:http://www.cnblogs.com/dydx/p/4364037.html