您的位置:首页 > 其它

Max Script|控制器-旋转约束_lookat

2016-05-10 17:41 288 查看
记录旋转控制器调用细节

T = teapot()                                --创建茶壶


C = circle radius:90 wirecolor:red          --创建圆环 半径 颜色


t.rotation.controller = lookat_constraint() --给茶壶增加looat约束


A = t.rotation.controller           --将茶壶的旋转约束赋予A


S = sphere radius:3 wirecolor:blue  --新建小球 半径 颜色


A.appendtarget $sphere001 50       --将小球附加到旋转约束中 权重50


A.lookat_vector_length = 50         --视线长度


A.viewline_length_abs = on          --绝对视线长度


A.set_orientation= off              --重置方向


A.relative = off                    --保持初始偏移


A.target_axis = 0                   --注视轴向


A.target_axisflip = on              --注视轴向反转开关


s2 = Sphere radius:10 pos:[100,0,0] --新建球体2


A.appendtarget $sphere002 20       --将球体2加入旋转约束


A.getnumtargets()                   --获取目标数


A.getweight 1                       --获取目标1的权重值并输出


A.getweight 2                       --获取目标2的权重值并输出


A.setweight 2 80                    --修改目标2的权重值
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: