記錄旋轉控制器調用細節
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的權重值