动画表达式算法的问题(物理或数学高手请进)
动画表达式算法的问题(物理或数学高手请进)
这是一段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是它的轮子.
这是一段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是它的轮子.
数学人气:563 ℃时间:2020-04-08 04:53:28
优质解答
我好同情你啊
我来回答
类似推荐
猜你喜欢
- 1用英语写春节的时间,怎么写
- 2why happy family very中的y读音哪个不同?
- 3When and where to go for the holiday__?___yet.
- 4the dishes are ________.let's__________them这中间填什么 有:dirty,dry clean,dirty
- 5以关爱为中心的作文(“我”关心别人的哪种)记住,是一关爱为中心的作文
- 6有甲乙两袋米,甲袋装米10千克.如果从乙袋中倒出1/3给甲袋,两袋米就一样重.乙袋原来装米多少千克?
- 7已知x5m-4+1/3=2是关于x的一元一次方程,那么m=_.
- 8get used to sth和be used to sth的意思以及用法并写出两个例句.
- 9乳酸异生成葡萄糖消耗6分子的ATP ,是怎样算的
- 10one day she bought a lot ____CDs.her best friend to listen__her new CDs with her.