/* macfly august 2001 */ var MAXMOVE = 100;; fun C3D_OperateVarDest (chg) = if chg > MAXMOVE then MAXMOVE else if chg < (-MAXMOVE) then (-MAXMOVE) else chg ;; fun C3D_UpdateDest (ob, vv) = let M3getObjVec session ob.o3Ob -> [x1 y1 z1] in let vv -> [x2 y2 z2] in ( set ob.destOb.C3DOMdestVector = vv; set ob.destOb.C3DOMvarVector = if x1 == 0 && y1 == 0 && z1== 0 then vv else [ C3D_OperateVarDest (x2-x1) C3D_OperateVarDest (y2-y1) C3D_OperateVarDest (z2-z1)]; set ob.destOb.C3DOMinterpolating = 1 ) ;; fun C3D_EvaluateMove (dest, cur, chg) = if chg == 0 then [dest 1] else let cur+chg -> new in if ((cur <= dest) && (dest <= new)) || ((cur >= dest) && (dest >= new)) then [dest 1] else [new 0] ;; fun C3D_InterpolateVec (ob) = if ob.destOb.C3DOMinterpolating then let M3getObjVec session ob.o3Ob -> [x1 y1 z1] in let ob.destOb.C3DOMvarVector -> [x2 y2 z2] in let ob.destOb.C3DOMdestVector -> [x3 y3 z3] in let C3D_EvaluateMove x3 x1 x2 -> [xx destx] in let C3D_EvaluateMove y3 y1 y2 -> [yy desty] in let C3D_EvaluateMove z3 z1 z2 -> [zz destz] in ( M3setObjVec session ob.o3Ob [xx yy zz]; if destx && desty && destz then set ob.destOb.C3DOMinterpolating = 0 else nil ) else nil ;;