Maya Wheel Rig with World Vectors
Andrew Christophersen
0:00 / 0:00
Maya Wheel Rig with World Vectors
26 942 просмотра · 10 л. назад
Andrew Christophersen
330 подписчиков
26 942 просмотра · 10 л. назад
http://www.andrewchristophersen.com/
float $radius = 25;
vector $moveVectorOld = `xform -q -ws -t "rightWheelOld"`;
vector $moveVector = `xform -q -ws -t "R_Wheel"`;
vector $dirVector = `xform -q -ws -t "rightWheelDir"`;
vector $wheelVector = ($dirVector - $moveVector);
vector $motionVector = ($moveVector - $moveVectorOld);
float $distance = mag($motionVector);
$dot = dotProduct($motionVector, $wheelVector, 1);
R_Wheel.rotateZ = R_Wheel.rotateZ + 360 / (6.283*$radius) * ($dot*$distance) * (Root_CTRL.rightWheelAuto);
xform -t ($moveVector.x) ($moveVector.y) ($moveVector.z) rightWheelOld;
if (frame==0) {
R_Wheel.rotateZ = 0;
}