动画表达式算法的问题(物理或数学高手请进)
这是一段MAYA中的动画表达式,如果您不会MAYA也没关系,相信只要你有程序基础和一定的物理或数学知识,就能回答如下问题.
谁能告诉我这段表达式算法的含义,,(注:我表达式语法没有问题,只解释算法就可以了,只给链接不给解释的混分族勿扰!)
// keep seat balanced
$seatHeight = unicycle:wheel.translateY + 0;
$seatX = unicycle:uniCycle.translateZ;
$wheelX = unicycle:wheel.translateZ;
$dist = abs(unicycle:wheel.translateZ - unicycle:uniCycle.translateZ);
if ($dist = 0)
unicycle:uniCycle.translateY = $seatHeight - $dist/3;
else
unicycle:uniCycle.translateY = $seatHeight;
// Rotation stuff
// global vector $twistold;
vector $twistpos =;
vector $spaz = $twistpos - ;
unicycle:wheel.twistoldX = $twistpos.x;
unicycle:wheel.twistoldY = $twistpos.y;
unicycle:wheel.twistoldZ = $twistpos.z;
//float $rad = wheel.scaleX;
float $rad = .035;
if ($spaz.z < 0)
{
unicycle:wheel.rotateX = unicycle:wheel.rotateX - mag($spaz)/$rad;
}
if ($spaz.z > 0)
{
unicycle:wheel.rotateX = unicycle:wheel.rotateX + mag($spaz)/$rad;
}
float $dt = 1.0 / 24.0;
float $d;
float $w = 0.0;
$w = $w * $w * $w;
float $a = 0.0;
if( frame == 1 )
{
unicycle:wheel.translateZ = (unicycle:uniCycle.translateZ + unicycle:wheel.translateZTouniCycle_translateZOffset );
}
$d = unicycle:uniCycle.translateZ + unicycle:wheel.translateZTouniCycle_translateZOffset - unicycle:wheel.translateZ;
$w = unicycle:wheel.translateZTouniCycle_translateZWeight; $w = $w * $w * $w;
$a = $w * ( ( $d / $dt ) - unicycle:wheel.translateZ_Velocity ) / $dt;
unicycle:wheel.translateZ_Velocity = unicycle:wheel.translateZ_Velocity + $a * $dt;
unicycle:wheel.translateZ = unicycle:wheel.translateZ + unicycle:wheel.translateZ_Velocity * $dt;
简要说明一下,unicycle:uniCycle是一个独轮自行车的坐架,unicycle:wheel是它的轮子.
人气:215 ℃ 时间:2020-04-08 04:53:28
解答
我好同情你啊
推荐
- 轮船在河流中逆流而上,突然船员发现轮船上一橡皮艇早已失落水中,船长命令马上掉转船头寻找小艇.经过一个小时的追寻,终于追上了顺流而下的小艇.如果轮船在整个过程中相对水的速度不变,那么据此判断,发现小艇失落时小艇已失落______小时.
- 怎样可以更牢记住数学和物理公式,要合理方法··
- 物理…思路公式都正确,为什么总是数学计算失误或者理解错误啊!
- 请问“点到平面的距离公式”是怎么推导出来的?为什么要先乘以法向量再除以法向量的模?
- 我在课本上看见有道例题将e^z中的z变成1/z然后代入写出e^1/z的级数,于是我也用这个方法解答e^(1/1-z),但是解出的结果与正确答案相差甚远,请问是怎么回事?
- kalenjin women won all their events as well(同义句转换)
- 虚数的虚数次方:i^i唯一吗
- 一个圆锥与一个圆柱的底面积比是3:2,体积比是2:5,如果圆柱的高与圆锥高之和是36厘米,求圆锥的高是多少厘米.
猜你喜欢